From 734f0830e56056d5c7cfeaa6beff7e7c32bb04e6 Mon Sep 17 00:00:00 2001 From: Natsumi Date: Wed, 30 Dec 2020 03:33:18 +1300 Subject: [PATCH] user dialog invite button --- html/src/app.js | 19 +++++++++++++++++++ html/src/index.pug | 2 ++ 2 files changed, 21 insertions(+) diff --git a/html/src/app.js b/html/src/app.js index fc064914..bff59675 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -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); diff --git a/html/src/index.pug b/html/src/index.pug index 7f86dc47..0fd1fa2f 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -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