Add workflow actions bridge to shell
- Expose SoulSyncWorkflowActions from the shell bridge - Route album download and wishlist actions to the legacy modal helpers - Fall back to showToast for workflow notifications - Unblock the issue modal download button by wiring the real host contract
This commit is contained in:
parent
f176ba1eb0
commit
538bb9344b
1 changed files with 33 additions and 0 deletions
|
|
@ -66,6 +66,39 @@ function activateLegacyPath(pathname) {
|
||||||
|
|
||||||
const SHELL_BRIDGE_READY_EVENT = 'ss:webui-shell-bridge-ready';
|
const SHELL_BRIDGE_READY_EVENT = 'ss:webui-shell-bridge-ready';
|
||||||
|
|
||||||
|
function openDownloadMissingAlbumWorkflow(input) {
|
||||||
|
if (typeof openDownloadMissingModalForArtistAlbum !== 'function') {
|
||||||
|
throw new Error('Download workflow host is not ready yet');
|
||||||
|
}
|
||||||
|
|
||||||
|
return openDownloadMissingModalForArtistAlbum(
|
||||||
|
input.virtualPlaylistId,
|
||||||
|
input.playlistName,
|
||||||
|
input.tracks,
|
||||||
|
input.album,
|
||||||
|
input.artist,
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function openAddToWishlistAlbumWorkflow(input) {
|
||||||
|
if (typeof openAddToWishlistModal !== 'function') {
|
||||||
|
throw new Error('Wishlist workflow host is not ready yet');
|
||||||
|
}
|
||||||
|
|
||||||
|
return openAddToWishlistModal(input.album, input.artist, input.tracks, input.albumType);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.SoulSyncWorkflowActions = {
|
||||||
|
openDownloadMissingAlbum: openDownloadMissingAlbumWorkflow,
|
||||||
|
openAddToWishlistAlbum: openAddToWishlistAlbumWorkflow,
|
||||||
|
notify(message, type) {
|
||||||
|
if (typeof showToast === 'function') {
|
||||||
|
showToast(message, type);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
window.SoulSyncWebShellBridge = {
|
window.SoulSyncWebShellBridge = {
|
||||||
getCurrentPageId() {
|
getCurrentPageId() {
|
||||||
return currentPage || getWebRouter()?.resolvePageId?.(window.location.pathname) || _getPageFromPath();
|
return currentPage || getWebRouter()?.resolvePageId?.(window.location.pathname) || _getPageFromPath();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue