mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
add enable mutual friends sharing prompt
This commit is contained in:
@@ -1418,7 +1418,8 @@
|
|||||||
sortUserDialogAvatars,
|
sortUserDialogAvatars,
|
||||||
refreshUserDialogAvatars,
|
refreshUserDialogAvatars,
|
||||||
refreshUserDialogTreeData,
|
refreshUserDialogTreeData,
|
||||||
showSendBoopDialog
|
showSendBoopDialog,
|
||||||
|
toggleSharedConnectionsOptOut
|
||||||
} = useUserStore();
|
} = useUserStore();
|
||||||
const { favoriteLimits } = storeToRefs(useFavoriteStore());
|
const { favoriteLimits } = storeToRefs(useFavoriteStore());
|
||||||
const { showFavoriteDialog, handleFavoriteWorldList } = useFavoriteStore();
|
const { showFavoriteDialog, handleFavoriteWorldList } = useFavoriteStore();
|
||||||
@@ -2443,12 +2444,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleSharedConnectionsOptOut() {
|
|
||||||
userRequest.saveCurrentUser({
|
|
||||||
hasSharedConnectionsOptOut: !currentUser.value.hasSharedConnectionsOptOut
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function resetHome() {
|
function resetHome() {
|
||||||
ElMessageBox.confirm('Continue? Reset Home', 'Confirm', {
|
ElMessageBox.confirm('Continue? Reset Home', 'Confirm', {
|
||||||
confirmButtonText: 'Confirm',
|
confirmButtonText: 'Confirm',
|
||||||
|
|||||||
@@ -320,6 +320,12 @@
|
|||||||
"confirm": "Start Fetch",
|
"confirm": "Start Fetch",
|
||||||
"cancel": "Maybe Later"
|
"cancel": "Maybe Later"
|
||||||
},
|
},
|
||||||
|
"enable_sharing_prompt": {
|
||||||
|
"title": "Enable Mutual Friends Sharing",
|
||||||
|
"message": "Mutual friends sharing is currently disabled. Do you want to enable it now?",
|
||||||
|
"confirm": "Enable",
|
||||||
|
"cancel": "Cancel"
|
||||||
|
},
|
||||||
"messages": {
|
"messages": {
|
||||||
"fetch_cancelled_graph_not_updated": "Fetch cancelled"
|
"fetch_cancelled_graph_not_updated": "Fetch cancelled"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2021,6 +2021,13 @@ export const useUserStore = defineStore('User', () => {
|
|||||||
sendBoopDialog.value.visible = true;
|
sendBoopDialog.value.visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleSharedConnectionsOptOut() {
|
||||||
|
userRequest.saveCurrentUser({
|
||||||
|
hasSharedConnectionsOptOut:
|
||||||
|
!currentUser.value.hasSharedConnectionsOptOut
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
state,
|
state,
|
||||||
|
|
||||||
@@ -2048,6 +2055,7 @@ export const useUserStore = defineStore('User', () => {
|
|||||||
getCurrentUser,
|
getCurrentUser,
|
||||||
handleConfig,
|
handleConfig,
|
||||||
showSendBoopDialog,
|
showSendBoopDialog,
|
||||||
checkNote
|
checkNote,
|
||||||
|
toggleSharedConnectionsOptOut
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -189,6 +189,10 @@
|
|||||||
try {
|
try {
|
||||||
const snapshot = await database.getMutualGraphSnapshot();
|
const snapshot = await database.getMutualGraphSnapshot();
|
||||||
if (!snapshot || snapshot.size === 0) {
|
if (!snapshot || snapshot.size === 0) {
|
||||||
|
if (isOptOut.value) {
|
||||||
|
promptEnableMutualFriendsSharing();
|
||||||
|
return;
|
||||||
|
}
|
||||||
await promptInitialFetch();
|
await promptInitialFetch();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -239,6 +243,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function promptEnableMutualFriendsSharing() {
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
t('view.charts.mutual_friend.enable_sharing_prompt.message'),
|
||||||
|
t('view.charts.mutual_friend.enable_sharing_prompt.title'),
|
||||||
|
{
|
||||||
|
confirmButtonText: t('view.charts.mutual_friend.enable_sharing_prompt.confirm'),
|
||||||
|
cancelButtonText: t('view.charts.mutual_friend.enable_sharing_prompt.cancel'),
|
||||||
|
type: 'info'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
userStore.toggleSharedConnectionsOptOut();
|
||||||
|
promptInitialFetch();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
// cancelled
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function cancelFetch() {
|
function cancelFetch() {
|
||||||
if (isFetching.value) {
|
if (isFetching.value) {
|
||||||
status.cancelRequested = true;
|
status.cancelRequested = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user