|
@@ -18,13 +18,15 @@ interface MainStoreState {
|
|
|
globalLoading: boolean
|
|
|
paneSizeConfig: any
|
|
|
showRowNextBottomDialog: boolean
|
|
|
+ markerPausedLimit: number
|
|
|
+ markerPausedTimer: any
|
|
|
}
|
|
|
|
|
|
interface MainStoreActions {
|
|
|
getMyUserInfo: () => Promise<ExtractApiResponse<'getMyUserInfo'> | undefined>
|
|
|
getUserMarkConfig: () => Promise<ExtractApiResponse<'getUserMarkConfig'> | undefined>
|
|
|
setUserMarkConfig: (config: ExtractApiResponse<'getUserMarkConfig'>) => void
|
|
|
- setNewMsgs: (msgData: { newCount: number; messages: any[] }) => void
|
|
|
+ setNewMsgs: (msgData: { newCount: number; messages: any[]; markerPausedLimit?: number }) => void
|
|
|
setOnline: (bool: boolean) => void
|
|
|
setLockScreen: (bool: boolean) => void
|
|
|
setKeepAliveViews: (name: string) => void
|
|
@@ -32,6 +34,7 @@ interface MainStoreActions {
|
|
|
setGlobalLoading: (name: boolean) => void
|
|
|
setPaneSizeConfig: (path: string, size: number) => void
|
|
|
setRowNextBottomDialogStatus: (bool: boolean) => void
|
|
|
+ setMarkerPausedLimit: (time: number) => void
|
|
|
}
|
|
|
|
|
|
const useMainStore = defineStore<'main', MainStoreState, Record<string, any>, MainStoreActions>('main', {
|
|
@@ -60,9 +63,24 @@ const useMainStore = defineStore<'main', MainStoreState, Record<string, any>, Ma
|
|
|
? JSON.parse(localStorage.getItem('paneSizeConfig') as string)
|
|
|
: {},
|
|
|
showRowNextBottomDialog: false,
|
|
|
+ markerPausedLimit: 0,
|
|
|
+ markerPausedTimer: null,
|
|
|
}
|
|
|
},
|
|
|
actions: {
|
|
|
+ setMarkerPausedLimit(time: number) {
|
|
|
+ if (time > 0 && this.markerPausedLimit == 0 && !this.markerPausedTimer) {
|
|
|
+ this.markerPausedLimit = time
|
|
|
+ this.markerPausedTimer = setInterval(() => {
|
|
|
+ this.markerPausedLimit = this.markerPausedLimit - 1000 < 0 ? 0 : this.markerPausedLimit - 1000
|
|
|
+ if (this.markerPausedLimit == 0) {
|
|
|
+ this.markerPausedLimit = 0
|
|
|
+ clearInterval(this.markerPausedTimer)
|
|
|
+ this.markerPausedTimer = null
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+ },
|
|
|
setRowNextBottomDialogStatus(bool: boolean) {
|
|
|
this.showRowNextBottomDialog = bool
|
|
|
},
|
|
@@ -93,6 +111,9 @@ const useMainStore = defineStore<'main', MainStoreState, Record<string, any>, Ma
|
|
|
},
|
|
|
setNewMsgs(msgData) {
|
|
|
this.newMsgs = msgData
|
|
|
+ if (this.markerPausedLimit == 0) {
|
|
|
+ this.setMarkerPausedLimit(msgData.markerPausedLimit || 0)
|
|
|
+ }
|
|
|
},
|
|
|
async getMyUserInfo() {
|
|
|
try {
|