user dialog invite button

This commit is contained in:
Natsumi
2020-12-30 03:33:18 +13:00
parent d7b473b36c
commit 734f0830e5
2 changed files with 21 additions and 0 deletions

View File

@@ -6495,6 +6495,25 @@ import gameLogService from './service/gamelog.js'
this.$message('Request invite sent');
return args;
});
} else if (command === 'Invite') {
var L = API.parseLocation(this.lastLocation);
API.getCachedWorld({
worldId: L.worldId
}).then((args) => {
API.sendNotification({
receiverUserId: D.id,
type: 'invite',
message: 'This is a generated invite',
seen: false,
details: {
worldId: this.lastLocation,
worldName: args.ref.name
}
}).then((args) => {
this.$message('Invite sent');
return args;
});
});
} else if (command === 'Show Avatar Details') {
var { currentAvatarImageUrl } = D.ref;
var id = extractFileId(currentAvatarImageUrl);

View File

@@ -750,6 +750,8 @@ html
el-dropdown-item(icon="el-icon-edit" command="Edit Bio") Bio
el-dropdown-item(icon="el-icon-switch-button" command="Logout" divided) Logout
template(v-else)
template(v-if="lastLocation && isGameRunning")
el-dropdown-item(icon="el-icon-message" command="Invite") Invite
template(v-if="userDialog.isFriend")
el-dropdown-item(icon="el-icon-postcard" command="Request Invite") Request Invite
//- el-dropdown-item(icon="el-icon-message" command="Message") Message