Skip to content

Commit

Permalink
fix(notifications): add archive state toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
dunklesToast committed Dec 19, 2021
1 parent 78c6a03 commit cbe2d24
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/modules/unraid/extensions/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,13 @@ export class UnraidModuleNotificationExtension<
);
if (code !== 0) throw new Error('Got non-zero exit code while deleting notification');
}

async toggleNotificationArchiveState(notificationName: string, isArchived: boolean): Promise<void> {
const { code } = await this.instance.execute(
`mv /tmp/notifications/${isArchived ? 'archive' : 'unread'}/${notificationName} /tmp/notifications/${
isArchived ? 'unread' : 'archive'
}/${notificationName}`
);
if (code !== 0) throw new Error('Got non-zero exit code while toggling archive state');
}
}

0 comments on commit cbe2d24

Please sign in to comment.