-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4823 from Shopify/notifications-cdn
Notification system with CDN
- Loading branch information
Showing
18 changed files
with
915 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@shopify/cli-kit': minor | ||
'@shopify/app': minor | ||
'@shopify/cli': minor | ||
--- | ||
|
||
Notification system |
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
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,35 @@ | ||
export interface GlobalContext { | ||
currentCommandId: string | ||
} | ||
|
||
let _globalContext: GlobalContext | undefined | ||
|
||
/** | ||
* Get the global context. | ||
* | ||
* @returns Global context. | ||
*/ | ||
function getGlobalContext(): GlobalContext { | ||
if (!_globalContext) { | ||
_globalContext = {currentCommandId: ''} | ||
} | ||
return _globalContext | ||
} | ||
|
||
/** | ||
* Get the current command ID. | ||
* | ||
* @returns Current command ID. | ||
*/ | ||
export function getCurrentCommandId(): string { | ||
return getGlobalContext().currentCommandId | ||
} | ||
|
||
/** | ||
* Set the current command ID. | ||
* | ||
* @param commandId - Command ID. | ||
*/ | ||
export function setCurrentCommandId(commandId: string): void { | ||
getGlobalContext().currentCommandId = commandId | ||
} |
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.