mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 14:56:06 +02:00
Upgrade to Vue3 and Element Plus (#1374)
* Update Vue devtools
* upgrade vue pinia element-plus vue-i18n, add vite
* fix: i18n
* global components
* change v-deep
* upgrade vue-lazyload
* data table
* update enlint and safe-dialog
* package.json and vite.config.js
* el-icon
* el-message
* vue 2 -> vue3 migration changes
* $pinia
* dialog
* el-popover slot
* lint
* chore
* slot
* scss
* remote state access
* misc
* jsconfig
* el-button size mini -> small
* :model-value
* ElMessageBox
* datatable
* remove v-lazyload
* template #dropdown
* mini -> small
* css
* byebye hideTooltips
* use sass-embedded
* Update SQLite, remove unneeded libraries
* Fix shift remove local avatar favorites
* Electron arm64
* arm64 support
* bye pug
* f-word vite hah
* misc
* remove safe dialog component
* Add self invite to launch dialog
* Fix errors
* Icons 1
* improve localfavorite loading performance
* improve favorites world item performance
* dialog visibility changes for Element Plus
* clear element plus error
* import performance
* revert App.vue hah
* hah
* Revert "Add self invite to launch dialog"
This reverts commit 4801cfad58.
* Toggle self invite/open in-game
* Self invite on launch dialog
* el-button icon
* el-icon
* fix user dialog tab switching logic
* fix PlayerList
* Formatting changes
* More icons
* Fix friend log table
* loading margin
* fix markdown
* fix world dialog tab switching issue
* Fixes and formatting
* fix: global i18n.t export
* fix favorites world tab not working
* Create instance, displayName
* Remove group members sort by userId
* Fix loading dialog tabs on swtich
* Star
* charts console.warn
* wip: fix charts
* wip: fix charts
* wip: charts composables
* fix favorite item tooltip warning
* Fixes and formatting
* Clean up image dialogs
* Remove unused method
* Fix platform/size border
* Fix platform/size border
* $vr
* fix friendExportDialogVisible binding
* ElMessageBox and Settings
* Login formatting
* Rename VR overlay query
* Fix image popover and userdialog badges
* Formatting
* Big buttons
* Fixes, update Cef
* Fix gameLog table nav buttons jumping around while using nav buttons
* Fix z-index
* vr overlay
* vite input add theme
* defineAsyncComponent
* ISO 639-1
* fix i18n
* clean t
* Formatting, fix calendar, rotate arrows
* Show user status when user is offline
* Fix VR overlay
* fix theme and clean up
* split InstanceActivity
* tweak
* Fix VR overlay formatting
* fix scss var
* AppDebug hahahaha
* Years
* remove reactive
* improve perf
* state hah…
* fix user rendering poblems when user object is not yet loaded
* improve perf
* Update avatar/world image uploader, licenses, remove previous images dialog (old images are now deleted)
* improve perf 1
* Suppress stray errors
* fix traveling location display issue
* Fix empty instance creator
* improve friend list refresh performance
* fix main charts
* fix chart
* Fix darkmode
* Fix avatar dialog tags
---------
Co-authored-by: pa <maplenagisa@gmail.com>
This commit is contained in:
+9
-47
@@ -1,6 +1,7 @@
|
||||
import Noty from 'noty';
|
||||
import { defineStore } from 'pinia';
|
||||
import { computed, reactive, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import * as workerTimers from 'worker-timers';
|
||||
import {
|
||||
inventoryRequest,
|
||||
@@ -8,8 +9,7 @@ import {
|
||||
vrcPlusIconRequest,
|
||||
vrcPlusImageRequest
|
||||
} from '../api';
|
||||
import { $app } from '../app';
|
||||
import { AppGlobal } from '../service/appConfig';
|
||||
import { AppDebug } from '../service/appConfig';
|
||||
import { watchState } from '../service/watchState';
|
||||
import {
|
||||
getEmojiFileName,
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
getPrintLocalDate
|
||||
} from '../shared/utils';
|
||||
import { useAdvancedSettingsStore } from './settings/advanced';
|
||||
import { useI18n } from 'vue-i18n-bridge';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
export const useGalleryStore = defineStore('Gallery', () => {
|
||||
const advancedSettingsStore = useAdvancedSettingsStore();
|
||||
@@ -45,8 +45,6 @@ export const useGalleryStore = defineStore('Gallery', () => {
|
||||
printTable: [],
|
||||
emojiTable: [],
|
||||
inventoryTable: [],
|
||||
previousImagesDialogVisible: false,
|
||||
previousImagesTable: [],
|
||||
fullscreenImageDialog: {
|
||||
visible: false,
|
||||
imageUrl: '',
|
||||
@@ -176,20 +174,6 @@ export const useGalleryStore = defineStore('Gallery', () => {
|
||||
}
|
||||
});
|
||||
|
||||
const previousImagesDialogVisible = computed({
|
||||
get: () => state.previousImagesDialogVisible,
|
||||
set: (value) => {
|
||||
state.previousImagesDialogVisible = value;
|
||||
}
|
||||
});
|
||||
|
||||
const previousImagesTable = computed({
|
||||
get: () => state.previousImagesTable,
|
||||
set: (value) => {
|
||||
state.previousImagesTable = value;
|
||||
}
|
||||
});
|
||||
|
||||
const fullscreenImageDialog = computed({
|
||||
get: () => state.fullscreenImageDialog,
|
||||
set: (value) => {
|
||||
@@ -200,14 +184,12 @@ export const useGalleryStore = defineStore('Gallery', () => {
|
||||
watch(
|
||||
() => watchState.isLoggedIn,
|
||||
(isLoggedIn) => {
|
||||
state.previousImagesTable = [];
|
||||
state.galleryTable = [];
|
||||
state.VRCPlusIconsTable = [];
|
||||
state.stickerTable = [];
|
||||
state.printTable = [];
|
||||
state.emojiTable = [];
|
||||
state.galleryDialogVisible = false;
|
||||
state.previousImagesDialogVisible = false;
|
||||
state.fullscreenImageDialog.visible = false;
|
||||
if (isLoggedIn) {
|
||||
tryDeleteOldPrints();
|
||||
@@ -290,7 +272,7 @@ export const useGalleryStore = defineStore('Gallery', () => {
|
||||
}
|
||||
if (files[0].size >= 100000000) {
|
||||
// 100MB
|
||||
$app.$message({
|
||||
ElMessage({
|
||||
message: t('message.file.too_large'),
|
||||
type: 'error'
|
||||
});
|
||||
@@ -298,7 +280,7 @@ export const useGalleryStore = defineStore('Gallery', () => {
|
||||
return;
|
||||
}
|
||||
if (!files[0].type.match(/image.*/)) {
|
||||
$app.$message({
|
||||
ElMessage({
|
||||
message: t('message.file.not_image'),
|
||||
type: 'error'
|
||||
});
|
||||
@@ -540,10 +522,10 @@ export const useGalleryStore = defineStore('Gallery', () => {
|
||||
for (const printId of idList) {
|
||||
await vrcPlusImageRequest.deletePrint(printId);
|
||||
const text = `Old print automatically deleted: ${printId}`;
|
||||
if (AppGlobal.errorNoty) {
|
||||
AppGlobal.errorNoty.close();
|
||||
if (AppDebug.errorNoty) {
|
||||
AppDebug.errorNoty.close();
|
||||
}
|
||||
AppGlobal.errorNoty = new Noty({
|
||||
AppDebug.errorNoty = new Noty({
|
||||
type: 'info',
|
||||
text
|
||||
}).show();
|
||||
@@ -554,24 +536,6 @@ export const useGalleryStore = defineStore('Gallery', () => {
|
||||
await refreshPrintTable();
|
||||
}
|
||||
|
||||
async function checkPreviousImageAvailable(images) {
|
||||
state.previousImagesTable = [];
|
||||
for (const image of images) {
|
||||
if (image.file && image.file.url) {
|
||||
const response = await fetch(image.file.url, {
|
||||
method: 'HEAD',
|
||||
redirect: 'follow'
|
||||
}).catch((error) => {
|
||||
console.error('Failed to check image availability:', error);
|
||||
return null;
|
||||
});
|
||||
if (response && response.status === 200) {
|
||||
state.previousImagesTable.push(image);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function showFullscreenImageDialog(imageUrl, fileName) {
|
||||
if (!imageUrl) {
|
||||
return;
|
||||
@@ -656,6 +620,7 @@ export const useGalleryStore = defineStore('Gallery', () => {
|
||||
|
||||
return {
|
||||
state,
|
||||
|
||||
galleryTable,
|
||||
galleryDialogVisible,
|
||||
galleryDialogGalleryLoading,
|
||||
@@ -673,8 +638,6 @@ export const useGalleryStore = defineStore('Gallery', () => {
|
||||
printTable,
|
||||
emojiTable,
|
||||
inventoryTable,
|
||||
previousImagesDialogVisible,
|
||||
previousImagesTable,
|
||||
fullscreenImageDialog,
|
||||
|
||||
showGalleryDialog,
|
||||
@@ -689,7 +652,6 @@ export const useGalleryStore = defineStore('Gallery', () => {
|
||||
refreshEmojiTable,
|
||||
getInventory,
|
||||
tryDeleteOldPrints,
|
||||
checkPreviousImageAvailable,
|
||||
showFullscreenImageDialog,
|
||||
handleStickerAdd,
|
||||
handleGalleryImageAdd,
|
||||
|
||||
Reference in New Issue
Block a user