diff --git a/html/src/app.js b/html/src/app.js index 3ef030e1..49650ddd 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -5489,7 +5489,6 @@ speechSynthesis.getVoices(); nextClearVRCXCacheCheck: 0, nextDiscordUpdate: 0, nextAutoStateChange: 0, - autoAcceptInviteRequests: 'Off', isDiscordActive: false, isGameRunning: false, isGameNoVR: true, @@ -14790,57 +14789,45 @@ speechSynthesis.getVoices(); API.$on('PIPELINE:NOTIFICATION', function (args) { var ref = args.json; - if (ref.type !== 'requestInvite' || $app.autoAcceptInviteRequests === 'Off') + if ( + ref.type !== 'requestInvite' || + $app.autoAcceptInviteRequests === 'Off' + ) return; var currentLocation = $app.lastLocation.location; if ($app.lastLocation.location === 'traveling') { currentLocation = $app.lastLocationDestination; } - if (!currentLocation) - return; + if (!currentLocation) return; var L = this.parseLocation(currentLocation); - switch ($app.autoAcceptInviteRequests) { - case 'All Favorites': - if (!$app.favoriteFriends.some(x => x.id === ref.senderUserId)) - break; - this.getCachedWorld({ - worldId: L.worldId - }).then((args) => { - this.sendInvite( - { - instanceId: L.tag, - worldId: L.tag, - worldName: args.ref.name, - rsvp: true - }, - ref.senderUserId - ).then((_args) => { - $app.$message('Auto Invite sent to ' + ref.senderUsername); - return _args; - }); - }); - break; - case 'Selected Favorites': - if (!$app.localFavoriteFriends.has(ref.senderUserId)) - break; - this.getCachedWorld({ - worldId: L.worldId - }).then((args) => { - this.sendInvite( - { - instanceId: L.tag, - worldId: L.tag, - worldName: args.ref.name, - rsvp: true - }, - ref.senderUserId - ).then((_args) => { - $app.$message('Auto Invite sent to ' + ref.senderUsername); - return _args; - }); - }); - break; - } + if ( + $app.autoAcceptInviteRequests === 'All Favorites' && + !$app.favoriteFriends.some((x) => x.id === ref.senderUserId) + ) + return; + + if ( + $app.autoAcceptInviteRequests === 'Selected Favorites' && + !$app.localFavoriteFriends.has(ref.senderUserId) + ) + return; + + this.getCachedWorld({ + worldId: L.worldId + }).then((args1) => { + this.sendInvite( + { + instanceId: L.tag, + worldId: L.tag, + worldName: args1.ref.name, + rsvp: true + }, + ref.senderUserId + ).then((_args) => { + $app.$message(`Auto invite sent to ${ref.senderUsername}`); + return _args; + }); + }); }); $app.data.unseenNotifications = []; @@ -15579,6 +15566,9 @@ speechSynthesis.getVoices(); VRCXStorage.Set('VRCX_CloseToTray', $app.data.isCloseToTray.toString()); await configRepository.remove('VRCX_CloseToTray'); } + if (!(await VRCXStorage.Get('VRCX_DatabaseLocation'))) { + await VRCXStorage.Set('VRCX_DatabaseLocation', ''); + } $app.data.disableWorldDatabase = (await VRCXStorage.Get('VRCX_DisableWorldDatabase')) === 'true'; $app.methods.saveVRCXWindowOption = async function () { diff --git a/html/src/localization/en/en.json b/html/src/localization/en/en.json index 1694cee8..2916b852 100644 --- a/html/src/localization/en/en.json +++ b/html/src/localization/en/en.json @@ -232,8 +232,8 @@ "auto_state_change_join_me_or_ask_me": "Join Me / Ask Me", "auto_state_change_join_me_or_busy": "Join Me / Busy", "auto_state_change_ask_me_or_busy": "Ask Me / Busy", - "auto_invite_request_accept": "Auto Invite Request Accept", - "auto_invite_request_accept_tooltip": "Automatically accept Invite Requests from Favorite friends", + "auto_invite_request_accept": "Auto Accept Invite Requests", + "auto_invite_request_accept_tooltip": "Automatically accept invite requests from favorite friends", "auto_invite_request_accept_off": "Off", "auto_invite_request_accept_favs": "All Favorites", "auto_invite_request_accept_selected_favs": "Selected Favorites"