Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Evil Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
23Sonics
Evil Sharkey
Commits
499e8895
Commit
499e8895
authored
5 months ago
by
Hazelnoot
Committed by
Hazelnoot
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
save filters for following feed
parent
463b9ac5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/frontend/src/pages/following-feed.vue
+32
-15
32 additions, 15 deletions
packages/frontend/src/pages/following-feed.vue
packages/frontend/src/store.ts
+10
-0
10 additions, 0 deletions
packages/frontend/src/store.ts
with
42 additions
and
15 deletions
packages/frontend/src/pages/following-feed.vue
+
32
−
15
View file @
499e8895
...
...
@@ -63,20 +63,42 @@ import { checkWordMute } from '@/scripts/check-word-mute.js';
import
SkUserRecentNotes
from
'
@/components/SkUserRecentNotes.vue
'
;
import
{
useScrollPositionManager
}
from
'
@/nirax.js
'
;
import
{
getScrollContainer
}
from
'
@/scripts/scroll.js
'
;
import
{
defaultStore
}
from
'
@/store.js
'
;
import
{
deepMerge
}
from
'
@/scripts/merge.js
'
;
const
props
=
withDefaults
(
defineProps
<
{
initialTab
?:
FollowingFeedTab
,
}
>
(),
{
initialTab
:
followingTab
,
const
withNonPublic
=
computed
({
get
:
()
=>
defaultStore
.
reactiveState
.
followingFeed
.
value
.
withNonPublic
,
set
:
value
=>
saveFollowingFilter
(
'
withNonPublic
'
,
value
),
});
const
withQuotes
=
computed
({
get
:
()
=>
defaultStore
.
reactiveState
.
followingFeed
.
value
.
withQuotes
,
set
:
value
=>
saveFollowingFilter
(
'
withQuotes
'
,
value
),
});
const
withReplies
=
computed
({
get
:
()
=>
defaultStore
.
reactiveState
.
followingFeed
.
value
.
withReplies
,
set
:
value
=>
saveFollowingFilter
(
'
withReplies
'
,
value
),
});
const
onlyFiles
=
computed
({
get
:
()
=>
defaultStore
.
reactiveState
.
followingFeed
.
value
.
onlyFiles
,
set
:
value
=>
saveFollowingFilter
(
'
onlyFiles
'
,
value
),
});
const
onlyMutuals
=
computed
({
get
:
()
=>
defaultStore
.
reactiveState
.
followingFeed
.
value
.
onlyMutuals
,
set
:
value
=>
saveFollowingFilter
(
'
onlyMutuals
'
,
value
),
});
// Based on timeline.saveTlFilter()
function
saveFollowingFilter
(
key
:
keyof
typeof
defaultStore
.
state
.
followingFeed
,
value
:
boolean
)
{
const
out
=
deepMerge
({
[
key
]:
value
},
defaultStore
.
state
.
followingFeed
);
defaultStore
.
set
(
'
followingFeed
'
,
out
);
}
const
router
=
useRouter
();
// Vue complains, but we *want* to lose reactivity here.
// Otherwise, the user would be unable to change the tab.
// eslint-disable-next-line vue/no-setup-props-reactivity-loss
const
currentTab
:
Ref
<
FollowingFeedTab
>
=
ref
(
props
.
initialTab
);
const
mutualsOnly
:
Ref
<
boolean
>
=
computed
(()
=>
currentTab
.
value
===
mutualsTab
);
const
currentTab
=
computed
({
get
:
()
=>
onlyMutuals
.
value
?
mutualsTab
:
followingTab
,
set
:
value
=>
onlyMutuals
.
value
=
(
value
===
mutualsTab
),
});
const
userRecentNotes
=
shallowRef
<
InstanceType
<
typeof
SkUserRecentNotes
>>
();
const
userScroll
=
shallowRef
<
HTMLElement
>
();
const
noteScroll
=
shallowRef
<
HTMLElement
>
();
...
...
@@ -161,7 +183,7 @@ const latestNotesPagination: Paging<'notes/following'> = {
endpoint
:
'
notes/following
'
as
const
,
limit
:
20
,
params
:
computed
(()
=>
({
mutualsOnly
:
m
utuals
Only
.
value
,
mutualsOnly
:
onlyM
utuals
.
value
,
filesOnly
:
onlyFiles
.
value
,
includeNonPublic
:
withNonPublic
.
value
,
includeReplies
:
withReplies
.
value
,
...
...
@@ -169,11 +191,6 @@ const latestNotesPagination: Paging<'notes/following'> = {
})),
};
const
withNonPublic
=
ref
(
false
);
const
withQuotes
=
ref
(
false
);
const
withReplies
=
ref
(
false
);
const
onlyFiles
=
ref
(
false
);
const
headerActions
:
PageHeaderItem
[]
=
[
{
icon
:
'
ti ti-refresh
'
,
...
...
This diff is collapsed.
Click to expand it.
packages/frontend/src/store.ts
+
10
−
0
View file @
499e8895
...
...
@@ -239,6 +239,16 @@ export const defaultStore = markRaw(new Storage('base', {
where
:
'
deviceAccount
'
,
default
:
[]
as
Misskey
.
entities
.
UserList
[],
},
followingFeed
:
{
where
:
'
account
'
,
default
:
{
withNonPublic
:
false
,
withQuotes
:
false
,
withReplies
:
false
,
onlyFiles
:
false
,
onlyMutuals
:
false
,
},
},
overridedDeviceKind
:
{
where
:
'
device
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment