mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 06:43:51 +02:00
Tray notification icon dot
This commit is contained in:
@@ -23,6 +23,7 @@ export const useUiStore = defineStore('Ui', () => {
|
||||
|
||||
const notifiedMenus = ref([]);
|
||||
const shiftHeld = ref(false);
|
||||
const trayIconNotify = ref(false);
|
||||
|
||||
watch(
|
||||
() => watchState.isLoggedIn,
|
||||
@@ -41,6 +42,7 @@ export const useUiStore = defineStore('Ui', () => {
|
||||
!notifiedMenus.value.includes(index)
|
||||
) {
|
||||
notifiedMenus.value.push(index);
|
||||
updateTrayIconNotify();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +60,22 @@ export const useUiStore = defineStore('Ui', () => {
|
||||
|
||||
function removeNotify(index) {
|
||||
notifiedMenus.value = notifiedMenus.value.filter((i) => i !== index);
|
||||
updateTrayIconNotify();
|
||||
}
|
||||
|
||||
function updateTrayIconNotify() {
|
||||
const newState =
|
||||
notifiedMenus.value.includes('notification') ||
|
||||
notifiedMenus.value.includes('friendLog');
|
||||
|
||||
if (trayIconNotify.value !== newState) {
|
||||
trayIconNotify.value = newState;
|
||||
if (LINUX) {
|
||||
window.electron.setTrayIconNotification(trayIconNotify.value);
|
||||
return;
|
||||
}
|
||||
AppApi.SetTrayIconNotification(trayIconNotify.value);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
2
src/types/globals.d.ts
vendored
2
src/types/globals.d.ts
vendored
@@ -36,6 +36,7 @@ declare global {
|
||||
};
|
||||
electron: {
|
||||
getArch: () => Promise<string>;
|
||||
setTrayIconNotification: (notify: boolean) => Promise<void>;
|
||||
openFileDialog: () => Promise<string>;
|
||||
openDirectoryDialog: () => Promise<string>;
|
||||
desktopNotification: (
|
||||
@@ -187,6 +188,7 @@ declare global {
|
||||
CopyImageToClipboard(path: string): Promise<void>;
|
||||
FlashWindow(): Promise<void>;
|
||||
SetUserAgent(): Promise<void>;
|
||||
SetTrayIconNotification(notify: boolean): Promise<void>;
|
||||
|
||||
// Common Functions
|
||||
GetColourFromUserID(userId: string): Promise<number>;
|
||||
|
||||
Reference in New Issue
Block a user