mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 15:36:33 +00:00
fix(ci): narrow the page edit result for the non-strict compile, the invite signature within its line, one journey key used
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
"files.ts": 4,
|
||||
"help.ts": 3,
|
||||
"inspector.ts": 4,
|
||||
"journey.ts": 66,
|
||||
"journey.ts": 65,
|
||||
"login.ts": 1,
|
||||
"map.ts": 5,
|
||||
"memories.ts": 8,
|
||||
|
||||
@@ -116,9 +116,12 @@ function pageAfter(
|
||||
): BookDocument | string {
|
||||
if (!ops) return doc;
|
||||
const made = applyBookOps(doc, { spreadId, ops }, base.ctx);
|
||||
if (made.ok) return made.doc;
|
||||
const at = made.error.opIndex === null ? '' : ` (operation ${made.error.opIndex})`;
|
||||
return `Not a change the book takes${at}: ${made.error.code}: ${made.error.message}`;
|
||||
// Compared with false, not read as a truth value: the non-strict compile narrows the union only that way.
|
||||
if (made.ok === false) {
|
||||
const at = made.error.opIndex === null ? '' : ` (operation ${made.error.opIndex})`;
|
||||
return `Not a change the book takes${at}: ${made.error.code}: ${made.error.message}`;
|
||||
}
|
||||
return made.doc;
|
||||
}
|
||||
|
||||
/** What the message keeps of a look: the page, the version, the image's size when one came, the description. */
|
||||
|
||||
@@ -687,7 +687,7 @@ export class VacayService {
|
||||
// Invitations
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
async sendInvite(planId: number, inviterId: number, inviterUsername: string, targetUserId: number, socketId?: string): Promise<void> {
|
||||
async sendInvite(planId: number, inviterId: number, inviterName: string, targetUserId: number, socketId?: string) {
|
||||
if (targetUserId === inviterId) throw new DomainError(400, 'Cannot invite yourself');
|
||||
|
||||
// The picker no longer offers guests, but the id arrives from the client, so the
|
||||
@@ -706,7 +706,7 @@ export class VacayService {
|
||||
|
||||
await this.members.insertPending(planId, targetUserId);
|
||||
|
||||
const from = { id: inviterId, username: inviterUsername };
|
||||
const from = { id: inviterId, username: inviterName };
|
||||
this.realtime.broadcastToUser(targetUserId, { type: 'vacay:invite', from, planId });
|
||||
// The plan's own tabs list the pending invite too: vacay:settings reads the plan again.
|
||||
const planUserIds = (await this.getPlanUsers(planId)).map(u => u.id);
|
||||
@@ -717,7 +717,7 @@ export class VacayService {
|
||||
// nothing the module graph does not already give — NotificationsModule
|
||||
// reaches nothing in this direction — and it hid the edge while handing the
|
||||
// send a second NotificationsService built outside the container.
|
||||
this.notifications.send({ event: 'vacay_invite', actorId: inviterId, scope: 'user', targetId: targetUserId, params: { actor: inviterUsername, planId: String(planId) } }).catch(() => {});
|
||||
this.notifications.send({ event: 'vacay_invite', actorId: inviterId, scope: 'user', targetId: targetUserId, params: { actor: inviterName, planId: String(planId) } }).catch(() => {});
|
||||
}
|
||||
|
||||
async acceptInvite(userId: number, planId: number, socketId: string | undefined): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user