mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-14 12:23:52 +02:00
add enable mutual friends sharing prompt
This commit is contained in:
@@ -1418,7 +1418,8 @@
|
||||
sortUserDialogAvatars,
|
||||
refreshUserDialogAvatars,
|
||||
refreshUserDialogTreeData,
|
||||
showSendBoopDialog
|
||||
showSendBoopDialog,
|
||||
toggleSharedConnectionsOptOut
|
||||
} = useUserStore();
|
||||
const { favoriteLimits } = storeToRefs(useFavoriteStore());
|
||||
const { showFavoriteDialog, handleFavoriteWorldList } = useFavoriteStore();
|
||||
@@ -2443,12 +2444,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
function toggleSharedConnectionsOptOut() {
|
||||
userRequest.saveCurrentUser({
|
||||
hasSharedConnectionsOptOut: !currentUser.value.hasSharedConnectionsOptOut
|
||||
});
|
||||
}
|
||||
|
||||
function resetHome() {
|
||||
ElMessageBox.confirm('Continue? Reset Home', 'Confirm', {
|
||||
confirmButtonText: 'Confirm',
|
||||
|
||||
@@ -320,6 +320,12 @@
|
||||
"confirm": "Start Fetch",
|
||||
"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": {
|
||||
"fetch_cancelled_graph_not_updated": "Fetch cancelled"
|
||||
},
|
||||
|
||||
@@ -2021,6 +2021,13 @@ export const useUserStore = defineStore('User', () => {
|
||||
sendBoopDialog.value.visible = true;
|
||||
}
|
||||
|
||||
function toggleSharedConnectionsOptOut() {
|
||||
userRequest.saveCurrentUser({
|
||||
hasSharedConnectionsOptOut:
|
||||
!currentUser.value.hasSharedConnectionsOptOut
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
state,
|
||||
|
||||
@@ -2048,6 +2055,7 @@ export const useUserStore = defineStore('User', () => {
|
||||
getCurrentUser,
|
||||
handleConfig,
|
||||
showSendBoopDialog,
|
||||
checkNote
|
||||
checkNote,
|
||||
toggleSharedConnectionsOptOut
|
||||
};
|
||||
});
|
||||
|
||||
@@ -189,6 +189,10 @@
|
||||
try {
|
||||
const snapshot = await database.getMutualGraphSnapshot();
|
||||
if (!snapshot || snapshot.size === 0) {
|
||||
if (isOptOut.value) {
|
||||
promptEnableMutualFriendsSharing();
|
||||
return;
|
||||
}
|
||||
await promptInitialFetch();
|
||||
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() {
|
||||
if (isFetching.value) {
|
||||
status.cancelRequested = true;
|
||||
|
||||
Reference in New Issue
Block a user