Skip to content

Commit

Permalink
Don't play sounds for notes rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
gdbroman committed Aug 3, 2023
1 parent d655187 commit d81100b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
13 changes: 2 additions & 11 deletions app/src/os/services/ship/notes/notes.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export class NotesService extends AbstractService<NotesService_IPCUpdate> {
);
if (!notesEditsTable) return;

// 5. Insert all missing notes updates in SQLite.
// 5. Upsert all missing notes updates in SQLite.
const notesEditsTableRows = notesEditsTable.rows ?? [];
notesEditsTableRows.forEach((noteEdit) => {
const rowData: BedrockRowData_NotesEdits = noteEdit.data;
Expand All @@ -303,6 +303,7 @@ export class NotesService extends AbstractService<NotesService_IPCUpdate> {
});

// 6. Post notes updates that weren't in Bedrock.
// This can happen if the user closes before the updates are sent.
const notesDBNotesEdits = this.notesDB.selectAllNotesEdits();
notesDBNotesEdits.forEach((noteEdit) => {
const noteEditExistsInBedrock = notesEditsTableRows.find(
Expand All @@ -316,16 +317,6 @@ export class NotesService extends AbstractService<NotesService_IPCUpdate> {
});
}
});
// Unsynced local changes.
// const notesDBLocalNotesEdits = this.notesDB.selectAllLocalNotesEdits();
// notesDBLocalNotesEdits.forEach((noteEdit) => {
// this.createNoteUpdate({
// note_id: noteEdit.note_id,
// edit: noteEdit.note_edit,
// space,
// });
// });
// this.notesDB.deleteAllLocalNotesEdits();
}

editNoteTitle({ id, space, title }: NotesService_EditNoteTitle_Payload) {
Expand Down
8 changes: 6 additions & 2 deletions app/src/renderer/apps/Rooms/store/RoomsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,10 @@ export class RoomsStore extends EventsEmitter {
console.log('someone entered the room', event);
this.createPeer(event.peer_id);

shipStore.settingsStore.systemSoundsEnabled &&
const isRoomsNote = event.room.title.startsWith('Notes:');
if (shipStore.settingsStore.systemSoundsEnabled && !isRoomsNote) {
SoundActions.playRoomPeerEnter();
}
}
}
break;
Expand All @@ -548,8 +550,10 @@ export class RoomsStore extends EventsEmitter {
this.hangupAllPeers();
} else {
// someone left the room
shipStore.settingsStore.systemSoundsEnabled &&
const isRoomsNote = event.room.title.startsWith('Notes:');
if (shipStore.settingsStore.systemSoundsEnabled && !isRoomsNote) {
SoundActions.playRoomPeerLeave();
}
console.log('someone left the room', event);
this.destroyPeer(event.peer_id);
this.rooms.get(event.rid)?.removePeer(event.peer_id);
Expand Down

0 comments on commit d81100b

Please sign in to comment.