refactor: app.js (#1291)

* refactor: frontend

* Fix avatar gallery sort

* Update .NET dependencies

* Update npm dependencies

electron v37.1.0

* bulkRefreshFriends

* fix dark theme

* Remove crowdin

* Fix config.json dialog not updating

* VRCX log file fixes & add Cef log

* Remove SharedVariable, fix startup

* Revert init theme change

* Logging date not working? Fix WinformThemer designer error

* Add Cef request hander, no more escaping main page

* clean

* fix

* fix

* clean

* uh

* Apply thememode at startup, fixes random user colours

* Split database into files

* Instance info remove empty lines

* Open external VRC links with VRCX

* Electron fixes

* fix userdialog style

* ohhhh

* fix store

* fix store

* fix: load all group members after kicking a user

* fix: world dialog favorite button style

* fix: Clear VRCX Cache Timer input value

* clean

* Fix VR overlay

* Fix VR overlay 2

* Fix Discord discord rich presence for RPC worlds

* Clean up age verified user tags

* Fix playerList being occupied after program reload

* no `this`

* Fix login stuck loading

* writable: false

* Hide dialogs on logout

* add flush sync option

* rm LOGIN event

* rm LOGOUT event

* remove duplicate event listeners

* remove duplicate event listeners

* clean

* remove duplicate event listeners

* clean

* fix theme style

* fix t

* clearable

* clean

* fix ipcEvent

* Small changes

* Popcorn Palace support

* Remove checkActiveFriends

* Clean up

* Fix dragEnterCef

* Block API requests when not logged in

* Clear state on login & logout

* Fix worldDialog instances not updating

* use <script setup>

* Fix avatar change event, CheckGameRunning at startup

* Fix image dragging

* fix

* Remove PWI

* fix updateLoop

* add webpack-dev-server to dev environment

* rm unnecessary chunks

* use <script setup>

* webpack-dev-server changes

* use <script setup>

* use <script setup>

* Fix UGC text size

* Split login event

* t

* use <script setup>

* fix

* Update .gitignore and enable checkJs in jsconfig

* fix i18n t

* use <script setup>

* use <script setup>

* clean

* global types

* fix

* use checkJs for debugging

* Add watchState for login watchers

* fix .vue template

* type fixes

* rm Vue.filter

* Cef v138.0.170, VC++ 2022

* Settings fixes

* Remove 'USER:CURRENT'

* clean up 2FA callbacks

* remove userApply

* rm i18n import

* notification handling to use notification store methods

* refactor favorite handling to use favorite store methods and clean up event emissions

* refactor moderation handling to use dedicated functions for player moderation events

* refactor friend handling to use dedicated functions for friend events

* Fix program startup, move lang init

* Fix friend state

* Fix status change error

* Fix user notes diff

* fix

* rm group event

* rm auth event

* rm avatar event

* clean

* clean

* getUser

* getFriends

* getFavoriteWorlds, getFavoriteAvatars

* AvatarGalleryUpload btn style & package.json update

* Fix friend requests

* Apply user

* Apply world

* Fix note diff

* Fix VR overlay

* Fixes

* Update build scripts

* Apply avatar

* Apply instance

* Apply group

* update hidden VRC+ badge

* Fix sameInstance "private"

* fix 502/504 API errors

* fix 502/504 API errors

* clean

* Fix friend in same instance on orange showing twice in friends list

* Add back in broken friend state repair methods

* add types

---------

Co-authored-by: Natsumi <cmcooper123@hotmail.com>
This commit is contained in:
pa
2025-07-14 12:00:08 +09:00
committed by GitHub
parent 952fd77ed5
commit f4f78bb5ec
323 changed files with 47745 additions and 43326 deletions

View File

@@ -29,8 +29,8 @@
@click="showWorldDialog(currentInstanceWorld.ref.id)">
<i
v-show="
API.currentUser.$homeLocation &&
API.currentUser.$homeLocation.worldId === currentInstanceWorld.ref.id
currentUser.$homeLocation &&
currentUser.$homeLocation.worldId === currentInstanceWorld.ref.id
"
class="el-icon-s-home"
style="margin-right: 5px"></i>
@@ -132,16 +132,13 @@
</el-tag>
</div>
<div style="margin-top: 5px">
<location-world
:locationobject="currentInstanceLocation"
:currentuserid="API.currentUser.id"
@show-launch-dialog="showLaunchDialog"></location-world>
<LocationWorld :locationobject="currentInstanceLocation" :currentuserid="currentUser.id" />
<span v-if="lastLocation.playerList.size > 0" style="margin-left: 5px">
{{ lastLocation.playerList.size }}
<template v-if="lastLocation.friendList.size > 0"
>({{ lastLocation.friendList.size }})</template
>
&nbsp;&horbar; <timer v-if="lastLocation.date" :epoch="lastLocation.date"></timer>
&nbsp;&horbar; <Timer v-if="lastLocation.date" :epoch="lastLocation.date" />
</span>
</div>
<div style="margin-top: 5px">
@@ -175,8 +172,8 @@
<div class="detail">
<span class="name">{{ t('dialog.world.info.capacity') }}</span>
<span class="extra"
>{{ currentInstanceWorld.ref.recommendedCapacity | commaNumber }} ({{
currentInstanceWorld.ref.capacity | commaNumber
>{{ commaNumber(currentInstanceWorld.ref.recommendedCapacity) }} ({{
commaNumber(currentInstanceWorld.ref.capacity)
}})</span
>
</div>
@@ -184,13 +181,15 @@
<div class="x-friend-item" style="cursor: default">
<div class="detail">
<span class="name">{{ t('dialog.world.info.last_updated') }}</span>
<span class="extra">{{ currentInstanceWorld.lastUpdated | formatDate('long') }}</span>
<span class="extra">{{ formatDateFilter(currentInstanceWorld.lastUpdated, 'long') }}</span>
</div>
</div>
<div class="x-friend-item" style="cursor: default">
<div class="detail">
<span class="name">{{ t('dialog.world.info.created_at') }}</span>
<span class="extra">{{ currentInstanceWorld.ref.created_at | formatDate('long') }}</span>
<span class="extra">{{
formatDateFilter(currentInstanceWorld.ref.created_at, 'long')
}}</span>
</div>
</div>
</div>
@@ -245,9 +244,9 @@
<template #default="scope">
<el-tooltip placement="right">
<template #content>
<span>{{ scope.row.created_at | formatDate('long') }}</span>
<span>{{ formatDateFilter(scope.row.created_at, 'long') }}</span>
</template>
<span>{{ scope.row.created_at | formatDate('short') }}</span>
<span>{{ formatDateFilter(scope.row.created_at, 'short') }}</span>
</el-tooltip>
</template>
</el-table-column>
@@ -377,11 +376,11 @@
v-else-if="scope.row.type === 'PortalSpawn'"
class="x-link"
@click="showWorldDialog(scope.row.location, scope.row.shortName)">
<location
<Location
:location="scope.row.location"
:hint="scope.row.worldName"
:grouphint="scope.row.groupName"
:link="false"></location>
:link="false" />
</span>
<span
v-else-if="scope.row.type === 'ChatBoxMessage'"
@@ -445,9 +444,9 @@
<template #default="scope">
<el-tooltip placement="right">
<template #content>
<span>{{ scope.row.created_at | formatDate('long') }}</span>
<span>{{ formatDateFilter(scope.row.created_at, 'long') }}</span>
</template>
<span>{{ scope.row.created_at | formatDate('short') }}</span>
<span>{{ formatDateFilter(scope.row.created_at, 'short') }}</span>
</el-tooltip>
</template>
</el-table-column>
@@ -577,11 +576,11 @@
v-else-if="scope.row.type === 'PortalSpawn'"
class="x-link"
@click="showWorldDialog(scope.row.location, scope.row.shortName)">
<location
<Location
:location="scope.row.location"
:hint="scope.row.worldName"
:grouphint="scope.row.groupName"
:link="false"></location>
:link="false" />
</span>
<span
v-else-if="scope.row.type === 'ChatBoxMessage'"
@@ -665,7 +664,7 @@
</el-table-column>
<el-table-column :label="t('table.playerList.timer')" width="80" prop="timer" sortable>
<template #default="scope">
<timer :epoch="scope.row.timer"></timer>
<Timer :epoch="scope.row.timer" />
</template>
</el-table-column>
<el-table-column
@@ -824,138 +823,77 @@
</div>
<ChatboxBlacklistDialog
:chatbox-blacklist-dialog="chatboxBlacklistDialog"
:chatbox-user-blacklist="chatboxUserBlacklist"
@delete-chatbox-user-blacklist="deleteChatboxUserBlacklist" />
</div>
</template>
<script>
export default {
name: 'PlayerListTab'
};
</script>
<script setup>
import { inject, ref } from 'vue';
import { storeToRefs } from 'pinia';
import { ref } from 'vue';
import { useI18n } from 'vue-i18n-bridge';
import { languageClass } from '../../composables/user/utils';
import configRepository from '../../service/config';
import {
languageClass,
getFaviconUrl,
openExternalLink,
statusClass,
userImage,
userImageFull,
commaNumber,
formatDateFilter
} from '../../shared/utils';
import {
useLocationStore,
useAppearanceSettingsStore,
usePhotonStore,
useUserStore,
useAvatarStore,
useWorldStore,
useGroupStore,
useInstanceStore,
useUiStore,
useGalleryStore,
useVrcxStore
} from '../../stores';
import ChatboxBlacklistDialog from './dialogs/ChatboxBlacklistDialog.vue';
import { getFaviconUrl } from '../../composables/shared/utils';
import { photonEventTableTypeFilterList } from '../../shared/constants';
const { hideTooltips, randomUserColours } = storeToRefs(useAppearanceSettingsStore());
const {
photonLoggingEnabled,
photonEventIcon,
photonEventTableTypeFilter,
photonEventTable,
photonEventTablePrevious,
chatboxUserBlacklist,
photonEventTableFilter
} = storeToRefs(usePhotonStore());
const { saveChatboxUserBlacklist, photonEventTableFilterChange, showUserFromPhotonId } = usePhotonStore();
const { showUserDialog, lookupUser } = useUserStore();
const { showAvatarDialog } = useAvatarStore();
const { showWorldDialog } = useWorldStore();
const { showGroupDialog } = useGroupStore();
const { lastLocation } = storeToRefs(useLocationStore());
const { currentInstanceLocation, currentInstanceWorld } = storeToRefs(useInstanceStore());
const { currentInstanceUserList, getCurrentInstanceUserList } = useInstanceStore();
const { menuActiveIndex } = storeToRefs(useUiStore());
const { showFullscreenImageDialog } = useGalleryStore();
const { ipcEnabled } = storeToRefs(useVrcxStore());
const { currentUser } = storeToRefs(useUserStore());
const { t } = useI18n();
const API = inject('API');
const showFullscreenImageDialog = inject('showFullscreenImageDialog');
const showWorldDialog = inject('showWorldDialog');
const showUserDialog = inject('showUserDialog');
const showLaunchDialog = inject('showLaunchDialog');
const showAvatarDialog = inject('showAvatarDialog');
const statusClass = inject('statusClass');
const showGroupDialog = inject('showGroupDialog');
const openExternalLink = inject('openExternalLink');
const userImage = inject('userImage');
const userImageFull = inject('userImageFull');
const props = defineProps({
menuActiveIndex: {
type: String,
default: 'playerList'
},
currentInstanceWorld: {
type: Object,
default: () => ({})
},
currentInstanceLocation: {
type: Object,
default: () => ({})
},
currentInstanceWorldDescriptionExpanded: {
type: Boolean,
default: false
},
photonLoggingEnabled: {
type: Boolean,
default: false
},
photonEventTableTypeFilter: {
type: Array,
default: () => []
},
photonEventTableTypeFilterList: {
type: Array,
default: () => []
},
photonEventTableFilter: {
type: String,
default: ''
},
hideTooltips: {
type: Boolean,
default: false
},
ipcEnabled: {
type: Boolean,
default: false
},
photonEventIcon: {
type: Boolean,
default: false
},
photonEventTable: {
type: Object,
default: () => ({})
},
photonEventTablePrevious: {
type: Object,
default: () => ({})
},
currentInstanceUserList: {
type: Object,
default: () => ({})
},
chatboxUserBlacklist: {
type: Map
},
randomUserColours: {
type: Boolean,
default: false
},
lastLocation: {
type: Object,
default: () => ({})
}
});
const emit = defineEmits([
'photonEventTableFilterChange',
'getCurrentInstanceUserList',
'showUserFromPhotonId',
'lookupUser'
]);
const chatboxBlacklistDialog = ref({
visible: false,
loading: false
});
function photonEventTableFilterChange(value) {
emit('photonEventTableFilterChange', value);
}
const currentInstanceWorldDescriptionExpanded = ref(false);
function showChatboxBlacklistDialog() {
const D = chatboxBlacklistDialog.value;
D.visible = true;
}
function showUserFromPhotonId(photonId) {
emit('showUserFromPhotonId', photonId);
}
function lookupUser(user) {
emit('lookupUser', user);
}
function selectCurrentInstanceRow(val) {
if (val === null) {
return;
@@ -969,21 +907,14 @@
}
async function deleteChatboxUserBlacklist(userId) {
props.chatboxUserBlacklist.delete(userId);
chatboxUserBlacklist.value.delete(userId);
await saveChatboxUserBlacklist();
emit('getCurrentInstanceUserList');
}
async function saveChatboxUserBlacklist() {
await configRepository.setString(
'VRCX_chatboxUserBlacklist',
JSON.stringify(Object.fromEntries(props.chatboxUserBlacklist))
);
getCurrentInstanceUserList();
}
async function addChatboxUserBlacklist(user) {
props.chatboxUserBlacklist.set(user.id, user.displayName);
chatboxUserBlacklist.value.set(user.id, user.displayName);
await saveChatboxUserBlacklist();
emit('getCurrentInstanceUserList');
getCurrentInstanceUserList();
}
</script>