-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure distributions routes to the distributions page bump
- Loading branch information
Showing
12 changed files
with
47 additions
and
8 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
10 changes: 10 additions & 0 deletions
10
PWA/public/Services/FetchEventHandlers/DistributionsHandler.js
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,10 @@ | ||
import { RouteEvents } from "../../RouteEvents.js"; | ||
import { ResponseTools } from "../ResponseTools.js"; | ||
export class DistributionsHandler { | ||
canHandleEvent(event) { | ||
return event.request.url.endsWith(RouteEvents.distributions); | ||
} | ||
async handleEvent(event) { | ||
return await ResponseTools.fetchFromCacheWithRemoteAsFallBack(RouteEvents.home); | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
PWA/src/Services/FetchEventHandlers/DistributionsHandler.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,14 @@ | ||
import { FetchEvent } from "../../Interfaces/FetchEvent.js"; | ||
import { FetchEventHandler } from "../../Interfaces/FetchEventHandler.js"; | ||
import { RouteEvents } from "../../RouteEvents.js"; | ||
import { ResponseTools } from "../ResponseTools.js"; | ||
|
||
export class DistributionsHandler implements FetchEventHandler { | ||
canHandleEvent(event: FetchEvent): boolean { | ||
return event.request.url.endsWith(RouteEvents.distributions); | ||
} | ||
|
||
async handleEvent(event: FetchEvent): Promise<Response | undefined> { | ||
return await ResponseTools.fetchFromCacheWithRemoteAsFallBack(RouteEvents.home); | ||
} | ||
} |
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