Change use-marker config under the Settings from Preferences
This commit is contained in:
parent
76437ce599
commit
a4811dab7c
|
@ -16,8 +16,7 @@ const state = (): GeneralState => {
|
||||||
timeline: {
|
timeline: {
|
||||||
cw: false,
|
cw: false,
|
||||||
nsfw: false,
|
nsfw: false,
|
||||||
hideAllAttachments: false,
|
hideAllAttachments: false
|
||||||
useMarkerTimeline: []
|
|
||||||
},
|
},
|
||||||
other: {
|
other: {
|
||||||
launch: false
|
launch: false
|
||||||
|
|
|
@ -83,6 +83,10 @@ const state = (): TimelineSpaceState => {
|
||||||
direct: true,
|
direct: true,
|
||||||
local: true,
|
local: true,
|
||||||
public: true
|
public: true
|
||||||
|
},
|
||||||
|
useMarker: {
|
||||||
|
home: false,
|
||||||
|
notifications: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sns: 'mastodon',
|
sns: 'mastodon',
|
||||||
|
|
|
@ -141,6 +141,12 @@ const timelineState = {
|
||||||
account: {
|
account: {
|
||||||
accessToken: 'token',
|
accessToken: 'token',
|
||||||
baseURL: 'http://localhost'
|
baseURL: 'http://localhost'
|
||||||
|
},
|
||||||
|
timelineSetting: {
|
||||||
|
useMarker: {
|
||||||
|
home: false,
|
||||||
|
notifications: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,8 +154,7 @@ const timelineState = {
|
||||||
const appState = {
|
const appState = {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
state: {
|
state: {
|
||||||
proxyConfiguration: false,
|
proxyConfiguration: false
|
||||||
useMarkerTimeline: []
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -215,6 +215,12 @@ const timelineState = {
|
||||||
account: {
|
account: {
|
||||||
accessToken: 'token',
|
accessToken: 'token',
|
||||||
baseURL: 'http://localhost'
|
baseURL: 'http://localhost'
|
||||||
|
},
|
||||||
|
timelineSetting: {
|
||||||
|
useMarker: {
|
||||||
|
home: false,
|
||||||
|
notifications: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,7 @@ describe('Preferences/General', () => {
|
||||||
timeline: {
|
timeline: {
|
||||||
cw: false,
|
cw: false,
|
||||||
nsfw: false,
|
nsfw: false,
|
||||||
hideAllAttachments: false,
|
hideAllAttachments: false
|
||||||
useMarkerTimeline: []
|
|
||||||
},
|
},
|
||||||
other: {
|
other: {
|
||||||
launch: false
|
launch: false
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import TimelineSpace, { TimelineSpaceState, blankAccount, MUTATION_TYPES } from '~/src/renderer/store/TimelineSpace'
|
import TimelineSpace, { TimelineSpaceState, blankAccount, MUTATION_TYPES } from '~/src/renderer/store/TimelineSpace'
|
||||||
import { Base } from '~/src/constants/initializer/setting'
|
import { DefaultSetting } from '~/src/constants/initializer/setting'
|
||||||
|
|
||||||
describe('TimelineSpace', () => {
|
describe('TimelineSpace', () => {
|
||||||
describe('mutations', () => {
|
describe('mutations', () => {
|
||||||
|
@ -11,7 +11,7 @@ describe('TimelineSpace', () => {
|
||||||
loading: false,
|
loading: false,
|
||||||
emojis: [],
|
emojis: [],
|
||||||
tootMax: 500,
|
tootMax: 500,
|
||||||
timelineSetting: Base.timeline,
|
timelineSetting: DefaultSetting.timeline,
|
||||||
sns: 'mastodon',
|
sns: 'mastodon',
|
||||||
filters: []
|
filters: []
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,6 +111,11 @@
|
||||||
"direct": "Direct Messages",
|
"direct": "Direct Messages",
|
||||||
"local": "Local Timeline",
|
"local": "Local Timeline",
|
||||||
"public": "Public Timeline"
|
"public": "Public Timeline"
|
||||||
|
},
|
||||||
|
"use_marker": {
|
||||||
|
"title": "Load the timeline from the last reading position",
|
||||||
|
"home": "Home",
|
||||||
|
"notifications": "Notifications"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"filters": {
|
"filters": {
|
||||||
|
@ -162,8 +167,7 @@
|
||||||
"description": "Customize view in your timelines.",
|
"description": "Customize view in your timelines.",
|
||||||
"cw": "Always ignore contents warnings",
|
"cw": "Always ignore contents warnings",
|
||||||
"nsfw": "Always ignore NSFW of medias",
|
"nsfw": "Always ignore NSFW of medias",
|
||||||
"hideAllAttachments": "Hide all medias",
|
"hideAllAttachments": "Hide all medias"
|
||||||
"useMarker": "Load timeline from the last reading position"
|
|
||||||
},
|
},
|
||||||
"other": {
|
"other": {
|
||||||
"title": "Other options",
|
"title": "Other options",
|
||||||
|
|
|
@ -20,8 +20,7 @@ const sound: Sound = {
|
||||||
const timeline: Timeline = {
|
const timeline: Timeline = {
|
||||||
cw: false,
|
cw: false,
|
||||||
nsfw: false,
|
nsfw: false,
|
||||||
hideAllAttachments: false,
|
hideAllAttachments: false
|
||||||
useMarkerTimeline: ['notifications']
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const other: Other = {
|
const other: Other = {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Setting, Timeline, UnreadNotification } from '~/src/types/setting'
|
import { Setting, Timeline, UnreadNotification, UseMarker } from '~/src/types/setting'
|
||||||
|
|
||||||
const unreadNotification: UnreadNotification = {
|
const unreadNotification: UnreadNotification = {
|
||||||
direct: false,
|
direct: false,
|
||||||
|
@ -6,11 +6,17 @@ const unreadNotification: UnreadNotification = {
|
||||||
public: false
|
public: false
|
||||||
}
|
}
|
||||||
|
|
||||||
const timeline: Timeline = {
|
const useMarker: UseMarker = {
|
||||||
unreadNotification: unreadNotification
|
home: false,
|
||||||
|
notifications: true
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Base: Setting = {
|
const timeline: Timeline = {
|
||||||
|
unreadNotification: unreadNotification,
|
||||||
|
useMarker: useMarker
|
||||||
|
}
|
||||||
|
|
||||||
|
export const DefaultSetting: Setting = {
|
||||||
accountID: '',
|
accountID: '',
|
||||||
timeline: timeline
|
timeline: timeline
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import storage from 'electron-json-storage'
|
||||||
import log from 'electron-log'
|
import log from 'electron-log'
|
||||||
import objectAssignDeep from 'object-assign-deep'
|
import objectAssignDeep from 'object-assign-deep'
|
||||||
import { BaseSettings, Setting } from '~/src/types/setting'
|
import { BaseSettings, Setting } from '~/src/types/setting'
|
||||||
import { Base } from '~/src/constants/initializer/setting'
|
import { DefaultSetting } from '~/src/constants/initializer/setting'
|
||||||
import { isEmpty } from 'lodash'
|
import { isEmpty } from 'lodash'
|
||||||
|
|
||||||
export default class Settings {
|
export default class Settings {
|
||||||
|
@ -12,7 +12,7 @@ export default class Settings {
|
||||||
this.path = path
|
this.path = path
|
||||||
}
|
}
|
||||||
|
|
||||||
public async load(): Promise<BaseSettings> {
|
public async _load(): Promise<BaseSettings> {
|
||||||
try {
|
try {
|
||||||
const settings = await this._get()
|
const settings = await this._get()
|
||||||
if (isEmpty(settings)) {
|
if (isEmpty(settings)) {
|
||||||
|
@ -26,17 +26,16 @@ export default class Settings {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async get(accountID: string): Promise<Setting> {
|
public async get(accountID: string): Promise<Setting> {
|
||||||
const current = await this.load()
|
const current = await this._load()
|
||||||
const find: Setting | undefined = current.find(d => {
|
const find: Setting | undefined = current.find(d => {
|
||||||
return d.accountID === accountID
|
return d.accountID === accountID
|
||||||
})
|
})
|
||||||
if (find) {
|
if (find) {
|
||||||
return find
|
return objectAssignDeep({}, DefaultSetting, find)
|
||||||
}
|
}
|
||||||
const base = objectAssignDeep({}, Base, {
|
return objectAssignDeep({}, DefaultSetting, {
|
||||||
accountID: accountID
|
accountID: accountID
|
||||||
})
|
})
|
||||||
return base
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private _get(): Promise<BaseSettings> {
|
private _get(): Promise<BaseSettings> {
|
||||||
|
@ -58,7 +57,7 @@ export default class Settings {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async update(obj: Setting): Promise<BaseSettings> {
|
public async update(obj: Setting): Promise<BaseSettings> {
|
||||||
const current = await this.load()
|
const current = await this._load()
|
||||||
const find = current.find(d => {
|
const find = current.find(d => {
|
||||||
return d.accountID === obj.accountID
|
return d.accountID === obj.accountID
|
||||||
})
|
})
|
||||||
|
|
|
@ -23,12 +23,6 @@
|
||||||
<el-form-item for="hideAllAttachments" :label="$t('preferences.general.timeline.hideAllAttachments')">
|
<el-form-item for="hideAllAttachments" :label="$t('preferences.general.timeline.hideAllAttachments')">
|
||||||
<el-switch id="hideAllAttachments" v-model="timeline_hide_attachments" active-color="#13ce66"> </el-switch>
|
<el-switch id="hideAllAttachments" v-model="timeline_hide_attachments" active-color="#13ce66"> </el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item for="useMarker" :label="$t('preferences.general.timeline.useMarker')">
|
|
||||||
<el-checkbox-group v-model="timeline_use_marker">
|
|
||||||
<el-checkbox label="home" name="type"></el-checkbox>
|
|
||||||
<el-checkbox label="notifications" name="type"></el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-form class="other section" label-position="right" label-width="250px" size="small" v-if="notDarwin">
|
<el-form class="other section" label-position="right" label-width="250px" size="small" v-if="notDarwin">
|
||||||
<h3>{{ $t('preferences.general.other.title') }}</h3>
|
<h3>{{ $t('preferences.general.other.title') }}</h3>
|
||||||
|
@ -105,17 +99,6 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
timeline_use_marker: {
|
|
||||||
get() {
|
|
||||||
return this.$store.state.Preferences.General.general.timeline.useMarkerTimeline
|
|
||||||
},
|
|
||||||
set(value) {
|
|
||||||
console.log(value)
|
|
||||||
this.$store.dispatch('Preferences/General/updateTimeline', {
|
|
||||||
useMarkerTimeline: value
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
other_launch: {
|
other_launch: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.Preferences.General.general.other.launch
|
return this.$store.state.Preferences.General.general.other.launch
|
||||||
|
|
|
@ -15,6 +15,16 @@
|
||||||
<el-switch v-model="public" id="public" />
|
<el-switch v-model="public" id="public" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
|
<el-form class="use-marker section" size="medium" label-position="right" label-width="250px">
|
||||||
|
<h3>{{ $t('settings.timeline.use_marker.title') }}</h3>
|
||||||
|
<el-form-item for="marker_home" :label="$t('settings.timeline.use_marker.home')">
|
||||||
|
<el-switch v-model="marker_home" id="marker_home" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item for="marker_notifications" :label="$t('settings.timeline.use_marker.notifications')">
|
||||||
|
<el-switch v-model="marker_notifications" id="marker_notifications" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -51,6 +61,26 @@ export default {
|
||||||
public: value
|
public: value
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
marker_home: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.Settings.Timeline.setting.useMarker.home
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
this.$store.dispatch('Settings/Timeline/changeUseMarker', {
|
||||||
|
home: value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
marker_notifications: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.Settings.Timeline.setting.useMarker.notifications
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
this.$store.dispatch('Settings/Timeline/changeUseMarker', {
|
||||||
|
notifications: value
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
|
|
|
@ -27,7 +27,6 @@ export type AppState = {
|
||||||
hideAllAttachments: boolean
|
hideAllAttachments: boolean
|
||||||
tootPadding: number
|
tootPadding: number
|
||||||
userAgent: string
|
userAgent: string
|
||||||
useMarkerTimeline: Array<string>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const state = (): AppState => ({
|
const state = (): AppState => ({
|
||||||
|
@ -52,8 +51,7 @@ const state = (): AppState => ({
|
||||||
ignoreCW: false,
|
ignoreCW: false,
|
||||||
ignoreNSFW: false,
|
ignoreNSFW: false,
|
||||||
hideAllAttachments: false,
|
hideAllAttachments: false,
|
||||||
userAgent: 'Whalebird',
|
userAgent: 'Whalebird'
|
||||||
useMarkerTimeline: ['notifications']
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const MUTATION_TYPES = {
|
const MUTATION_TYPES = {
|
||||||
|
@ -67,8 +65,7 @@ const MUTATION_TYPES = {
|
||||||
ADD_FONT: 'addFont',
|
ADD_FONT: 'addFont',
|
||||||
UPDATE_IGNORE_CW: 'updateIgnoreCW',
|
UPDATE_IGNORE_CW: 'updateIgnoreCW',
|
||||||
UPDATE_IGNORE_NSFW: 'updateIgnoreNSFW',
|
UPDATE_IGNORE_NSFW: 'updateIgnoreNSFW',
|
||||||
UPDATE_HIDE_ALL_ATTACHMENTS: 'updateHideAllAttachments',
|
UPDATE_HIDE_ALL_ATTACHMENTS: 'updateHideAllAttachments'
|
||||||
UPDATE_USE_MARKER: 'updateUseMarker'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const mutations: MutationTree<AppState> = {
|
const mutations: MutationTree<AppState> = {
|
||||||
|
@ -105,9 +102,6 @@ const mutations: MutationTree<AppState> = {
|
||||||
},
|
},
|
||||||
[MUTATION_TYPES.UPDATE_HIDE_ALL_ATTACHMENTS]: (state: AppState, hideAllAttachments: boolean) => {
|
[MUTATION_TYPES.UPDATE_HIDE_ALL_ATTACHMENTS]: (state: AppState, hideAllAttachments: boolean) => {
|
||||||
state.hideAllAttachments = hideAllAttachments
|
state.hideAllAttachments = hideAllAttachments
|
||||||
},
|
|
||||||
[MUTATION_TYPES.UPDATE_USE_MARKER]: (state: AppState, useMarkerTimeline: Array<string>) => {
|
|
||||||
state.useMarkerTimeline = useMarkerTimeline
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +127,6 @@ const actions: ActionTree<AppState, RootState> = {
|
||||||
commit(MUTATION_TYPES.UPDATE_IGNORE_CW, conf.general.timeline.cw)
|
commit(MUTATION_TYPES.UPDATE_IGNORE_CW, conf.general.timeline.cw)
|
||||||
commit(MUTATION_TYPES.UPDATE_IGNORE_NSFW, conf.general.timeline.nsfw)
|
commit(MUTATION_TYPES.UPDATE_IGNORE_NSFW, conf.general.timeline.nsfw)
|
||||||
commit(MUTATION_TYPES.UPDATE_HIDE_ALL_ATTACHMENTS, conf.general.timeline.hideAllAttachments)
|
commit(MUTATION_TYPES.UPDATE_HIDE_ALL_ATTACHMENTS, conf.general.timeline.hideAllAttachments)
|
||||||
commit(MUTATION_TYPES.UPDATE_USE_MARKER, conf.general.timeline.useMarkerTimeline)
|
|
||||||
return conf
|
return conf
|
||||||
},
|
},
|
||||||
updateTheme: async ({ commit }, appearance: Appearance) => {
|
updateTheme: async ({ commit }, appearance: Appearance) => {
|
||||||
|
|
|
@ -21,8 +21,7 @@ const state = (): GeneralState => ({
|
||||||
timeline: {
|
timeline: {
|
||||||
cw: false,
|
cw: false,
|
||||||
nsfw: false,
|
nsfw: false,
|
||||||
hideAllAttachments: false,
|
hideAllAttachments: false
|
||||||
useMarkerTimeline: ['notifications']
|
|
||||||
},
|
},
|
||||||
other: {
|
other: {
|
||||||
launch: false
|
launch: false
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Module, MutationTree, ActionTree } from 'vuex'
|
import { Module, MutationTree, ActionTree } from 'vuex'
|
||||||
import { RootState } from '@/store'
|
import { RootState } from '@/store'
|
||||||
import { MyWindow } from '~/src/types/global'
|
import { MyWindow } from '~/src/types/global'
|
||||||
import { Setting, UnreadNotification, Timeline as TimelineSetting } from '~src/types/setting'
|
import { Setting, UnreadNotification, Timeline as TimelineSetting, UseMarker } from '~src/types/setting'
|
||||||
import { Base } from '~/src/constants/initializer/setting'
|
import { DefaultSetting } from '~/src/constants/initializer/setting'
|
||||||
|
|
||||||
const win = (window as any) as MyWindow
|
const win = (window as any) as MyWindow
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ export type TimelineState = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const state = (): TimelineState => ({
|
const state = (): TimelineState => ({
|
||||||
setting: Base.timeline
|
setting: DefaultSetting.timeline
|
||||||
})
|
})
|
||||||
|
|
||||||
export const MUTATION_TYPES = {
|
export const MUTATION_TYPES = {
|
||||||
|
@ -42,6 +42,19 @@ const actions: ActionTree<TimelineState, RootState> = {
|
||||||
await win.ipcRenderer.invoke('update-account-setting', setting)
|
await win.ipcRenderer.invoke('update-account-setting', setting)
|
||||||
dispatch('loadTimelineSetting')
|
dispatch('loadTimelineSetting')
|
||||||
return true
|
return true
|
||||||
|
},
|
||||||
|
changeUseMarker: async ({ dispatch, state, rootState }, timeline: { key: boolean }) => {
|
||||||
|
const marker: UseMarker = Object.assign({}, state.setting.useMarker, timeline)
|
||||||
|
const tl: TimelineSetting = Object.assign({}, state.setting, {
|
||||||
|
useMarker: marker
|
||||||
|
})
|
||||||
|
const setting: Setting = {
|
||||||
|
accountID: rootState.Settings.accountID!,
|
||||||
|
timeline: tl
|
||||||
|
}
|
||||||
|
await win.ipcRenderer.invoke('update-account-setting', setting)
|
||||||
|
dispatch('loadTimelineSetting')
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { AccountLoadError } from '@/errors/load'
|
||||||
import { TimelineFetchError } from '@/errors/fetch'
|
import { TimelineFetchError } from '@/errors/fetch'
|
||||||
import { MyWindow } from '~/src/types/global'
|
import { MyWindow } from '~/src/types/global'
|
||||||
import { Timeline, Setting } from '~src/types/setting'
|
import { Timeline, Setting } from '~src/types/setting'
|
||||||
import { Base } from '~/src/constants/initializer/setting'
|
import { DefaultSetting } from '~/src/constants/initializer/setting'
|
||||||
|
|
||||||
const win = (window as any) as MyWindow
|
const win = (window as any) as MyWindow
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ const state = (): TimelineSpaceState => ({
|
||||||
loading: false,
|
loading: false,
|
||||||
emojis: [],
|
emojis: [],
|
||||||
tootMax: 500,
|
tootMax: 500,
|
||||||
timelineSetting: Base.timeline,
|
timelineSetting: DefaultSetting.timeline,
|
||||||
sns: 'mastodon',
|
sns: 'mastodon',
|
||||||
filters: []
|
filters: []
|
||||||
})
|
})
|
||||||
|
|
|
@ -134,7 +134,7 @@ const actions: ActionTree<HomeState, RootState> = {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
})
|
})
|
||||||
|
|
||||||
if (rootState.App.useMarkerTimeline.includes('home') && localMarker !== null) {
|
if (rootState.TimelineSpace.timelineSetting.useMarker.home && localMarker !== null) {
|
||||||
const last = await client.getStatus(localMarker.last_read_id)
|
const last = await client.getStatus(localMarker.last_read_id)
|
||||||
const lastReadStatus = last.data
|
const lastReadStatus = last.data
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ const actions: ActionTree<HomeState, RootState> = {
|
||||||
return res.data
|
return res.data
|
||||||
},
|
},
|
||||||
getMarker: async ({ rootState }): Promise<LocalMarker | null> => {
|
getMarker: async ({ rootState }): Promise<LocalMarker | null> => {
|
||||||
if (!rootState.App.useMarkerTimeline.includes('home')) {
|
if (!rootState.TimelineSpace.timelineSetting.useMarker.home) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
const client = generator(
|
const client = generator(
|
||||||
|
|
|
@ -120,7 +120,7 @@ const actions: ActionTree<NotificationsState, RootState> = {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
})
|
})
|
||||||
|
|
||||||
if (rootState.App.useMarkerTimeline.includes('notifications') && localMarker !== null) {
|
if (rootState.TimelineSpace.timelineSetting.useMarker.notifications && localMarker !== null) {
|
||||||
// The result does not contain max_id's notification, when we specify max_id parameter in get notifications.
|
// The result does not contain max_id's notification, when we specify max_id parameter in get notifications.
|
||||||
// So we need to get max_id's notification.
|
// So we need to get max_id's notification.
|
||||||
const last = await client.getNotification(localMarker.last_read_id)
|
const last = await client.getNotification(localMarker.last_read_id)
|
||||||
|
@ -224,7 +224,7 @@ const actions: ActionTree<NotificationsState, RootState> = {
|
||||||
win.ipcRenderer.send('reset-badge')
|
win.ipcRenderer.send('reset-badge')
|
||||||
},
|
},
|
||||||
getMarker: async ({ rootState }): Promise<LocalMarker | null> => {
|
getMarker: async ({ rootState }): Promise<LocalMarker | null> => {
|
||||||
if (!rootState.App.useMarkerTimeline.includes('notifications')) {
|
if (!rootState.TimelineSpace.timelineSetting.useMarker.notifications) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
const client = generator(
|
const client = generator(
|
||||||
|
|
|
@ -4,8 +4,14 @@ export type UnreadNotification = {
|
||||||
public: boolean
|
public: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type UseMarker = {
|
||||||
|
home: boolean
|
||||||
|
notifications: boolean
|
||||||
|
}
|
||||||
|
|
||||||
export type Timeline = {
|
export type Timeline = {
|
||||||
unreadNotification: UnreadNotification
|
unreadNotification: UnreadNotification
|
||||||
|
useMarker: UseMarker
|
||||||
}
|
}
|
||||||
export type Setting = {
|
export type Setting = {
|
||||||
accountID: string
|
accountID: string
|
||||||
|
|
|
@ -2,5 +2,4 @@ export type Timeline = {
|
||||||
cw: boolean
|
cw: boolean
|
||||||
nsfw: boolean
|
nsfw: boolean
|
||||||
hideAllAttachments: boolean
|
hideAllAttachments: boolean
|
||||||
useMarkerTimeline: Array<string>
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue