refresh button on world dialog

This commit is contained in:
pypy
2020-09-08 21:17:05 +09:00
parent fd49149e09
commit 48d7478430
2 changed files with 24 additions and 2 deletions

View File

@@ -6441,7 +6441,28 @@ CefSharp.BindObjectAsync(
if (D.visible === false) {
return;
}
if (command === 'New Instance') {
if (command === 'Refresh') {
D.loading = true;
API.getWorld({
worldId: D.id
}).catch((err) => {
D.loading = false;
D.visible = false;
throw err;
}).then((args) => {
if (D.id === args.ref.id) {
D.loading = false;
D.ref = args.ref;
D.isFavorite = API.cachedFavoritesByObjectId.has(D.id);
D.rooms = [];
this.applyWorldDialogInstances();
if (args.cache) {
API.getWorld(args.params);
}
}
return args;
});
} else if (command === 'New Instance') {
this.showNewInstanceDialog(D.$location.tag);
} else if (command === 'Add Favorite') {
this.showFavoriteDialog('world', D.id);

View File

@@ -784,7 +784,8 @@ html
el-dropdown(trigger="click" @command="worldDialogCommand" size="small" style="margin-left:5px")
el-button(type="default" icon="el-icon-more" circle)
el-dropdown-menu(#default="dropdown")
el-dropdown-item(icon="el-icon-s-flag" command="New Instance") New Instance
el-dropdown-item(icon="el-icon-refresh" command="Refresh") Refresh
el-dropdown-item(icon="el-icon-s-flag" command="New Instance" divided) New Instance
el-dropdown-item(v-if="API.currentUser.$homeLocation && API.currentUser.$homeLocation.worldId === worldDialog.id" icon="el-icon-magic-stick" command="Reset Home" divided) Reset Home
el-dropdown-item(v-else icon="el-icon-s-home" command="Make Home" divided) Make Home
el-tabs