Fix opening group dialog

This commit is contained in:
Natsumi
2025-04-10 10:42:00 +10:00
parent 273fc1461d
commit f198301ac4
4 changed files with 12 additions and 13 deletions

View File

@@ -15,7 +15,6 @@ export default class extends baseClass {
_methods = { _methods = {
async migrateMemos() { async migrateMemos() {
var json = JSON.parse(await VRCXStorage.GetAll()); var json = JSON.parse(await VRCXStorage.GetAll());
database.begin();
for (var line in json) { for (var line in json) {
if (line.substring(0, 8) === 'memo_usr') { if (line.substring(0, 8) === 'memo_usr') {
var userId = line.substring(5); var userId = line.substring(5);
@@ -26,7 +25,6 @@ export default class extends baseClass {
} }
} }
} }
database.commit();
}, },
onUserMemoChange() { onUserMemoChange() {
@@ -47,15 +45,15 @@ export default class extends baseClass {
} }
}, },
saveUserMemo(id, memo) { async saveUserMemo(id, memo) {
if (memo) { if (memo) {
database.setUserMemo({ await database.setUserMemo({
userId: id, userId: id,
editedAt: new Date().toJSON(), editedAt: new Date().toJSON(),
memo memo
}); });
} else { } else {
database.deleteUserMemo(id); await database.deleteUserMemo(id);
} }
var ref = this.friends.get(id); var ref = this.friends.get(id);
if (ref) { if (ref) {

View File

@@ -169,7 +169,7 @@ export default class extends baseClass {
if (!L.groupId) { if (!L.groupId) {
return; return;
} }
this.showGroupDialog(L.groupId); $app.showGroupDialog(L.groupId);
} }
}, },
watch: { watch: {

View File

@@ -8,7 +8,7 @@
<i v-if="isTraveling" class="el-icon el-icon-loading" style="display: inline-block"></i> <i v-if="isTraveling" class="el-icon el-icon-loading" style="display: inline-block"></i>
<span>{{ text }}</span> <span>{{ text }}</span>
</span> </span>
<span v-if="groupName" :class="{ 'x-link': link }" @click="showGroupDialog">({{ groupName }})</span> <span v-if="groupName" :class="{ 'x-link': link }" @click="handleShowGroupDialog">({{ groupName }})</span>
<span v-if="region" class="flags" :class="region" style="display: inline-block; margin-left: 5px"></span> <span v-if="region" class="flags" :class="region" style="display: inline-block; margin-left: 5px"></span>
<i v-if="strict" class="el-icon el-icon-lock" style="display: inline-block; margin-left: 5px"></i> <i v-if="strict" class="el-icon el-icon-lock" style="display: inline-block; margin-left: 5px"></i>
</span> </span>
@@ -27,7 +27,8 @@
API: { default: window.API }, API: { default: window.API },
getWorldName: { default: window.$app?.getWorldName }, getWorldName: { default: window.$app?.getWorldName },
getGroupName: { default: window.$app?.getGroupName }, getGroupName: { default: window.$app?.getGroupName },
showWorldDialog: { default: window.$app?.showWorldDialog } showWorldDialog: { default: window.$app?.showWorldDialog },
showGroupDialog: { default: window.$app?.showGroupDialog }
}, },
props: { props: {
location: String, location: String,
@@ -141,7 +142,7 @@
} }
} }
}, },
showGroupDialog() { handleShowGroupDialog(){
let location = this.location; let location = this.location;
if (this.isTraveling) { if (this.isTraveling) {
location = this.traveling; location = this.traveling;

View File

@@ -220,8 +220,8 @@ class Database {
return memos; return memos;
} }
setUserMemo(entry) { async setUserMemo(entry) {
sqliteService.executeNonQuery( await sqliteService.executeNonQuery(
`INSERT OR REPLACE INTO memos (user_id, edited_at, memo) VALUES (@user_id, @edited_at, @memo)`, `INSERT OR REPLACE INTO memos (user_id, edited_at, memo) VALUES (@user_id, @edited_at, @memo)`,
{ {
'@user_id': entry.userId, '@user_id': entry.userId,
@@ -231,8 +231,8 @@ class Database {
); );
} }
deleteUserMemo(userId) { async deleteUserMemo(userId) {
sqliteService.executeNonQuery( await sqliteService.executeNonQuery(
`DELETE FROM memos WHERE user_id = @user_id`, `DELETE FROM memos WHERE user_id = @user_id`,
{ {
'@user_id': userId '@user_id': userId