-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add manage collectibles feature (#25)
Signed-off-by: ryanml <[email protected]> Co-authored-by: vvava <[email protected]>
- Loading branch information
Showing
20 changed files
with
383 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/background/services/settings/handlers/updateCollectiblesVisibility.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ExtensionRequest } from '@src/background/connections/extensionConnection/models'; | ||
import { ExtensionRequestHandler } from '@src/background/connections/models'; | ||
import { injectable } from 'tsyringe'; | ||
import { CollectiblesVisibility } from '../models'; | ||
import { SettingsService } from '../SettingsService'; | ||
|
||
type HandlerType = ExtensionRequestHandler< | ||
ExtensionRequest.SETTINGS_UPDATE_COLLECTIBLES_VISIBILITY, | ||
true, | ||
[collectiblesVisibility: CollectiblesVisibility] | ||
>; | ||
|
||
@injectable() | ||
export class UpdateCollectiblesVisibilityHandler implements HandlerType { | ||
method = ExtensionRequest.SETTINGS_UPDATE_COLLECTIBLES_VISIBILITY as const; | ||
|
||
constructor(private settingsService: SettingsService) {} | ||
|
||
handle: HandlerType['handle'] = async ({ request }) => { | ||
const [collectiblesVisibility] = request.params; | ||
|
||
await this.settingsService.setCollectiblesVisibility( | ||
collectiblesVisibility | ||
); | ||
|
||
return { | ||
...request, | ||
result: true, | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.