({
shareData,
legacyManifestUrl,
}: AppStartupLoadPlanOptions)
| 80 | } |
| 81 | |
| 82 | export function getAppStartupLoadPlan({ |
| 83 | shareData, |
| 84 | legacyManifestUrl, |
| 85 | }: AppStartupLoadPlanOptions): AppStartupLoadPlan { |
| 86 | const config = shareData?.config ?? null; |
| 87 | |
| 88 | if (shareData?.manifest) { |
| 89 | return { |
| 90 | kind: 'inline-manifest', |
| 91 | manifest: shareData.manifest, |
| 92 | config, |
| 93 | selectedImageId: getShareSelectedImageId(config), |
| 94 | logMessage: `[App] Loading from inline manifest in URL hash: ${shareData.manifest.name || 'unnamed'}`, |
| 95 | }; |
| 96 | } |
| 97 | |
| 98 | if (shareData?.manifestUrl) { |
| 99 | return { |
| 100 | kind: 'manifest-url', |
| 101 | manifestUrl: shareData.manifestUrl, |
| 102 | config, |
| 103 | selectedImageId: getShareSelectedImageId(config), |
| 104 | logMessage: `[App] Loading from combined URL hash: ${shareData.manifestUrl}`, |
| 105 | }; |
| 106 | } |
| 107 | |
| 108 | if (legacyManifestUrl) { |
| 109 | return { |
| 110 | kind: 'legacy-url', |
| 111 | manifestUrl: legacyManifestUrl, |
| 112 | config, |
| 113 | selectedImageId: null, |
| 114 | logMessage: `[App] Loading from URL parameter: ${legacyManifestUrl}`, |
| 115 | }; |
| 116 | } |
| 117 | |
| 118 | return { |
| 119 | kind: 'none', |
| 120 | config, |
| 121 | selectedImageId: null, |
| 122 | logMessage: null, |
| 123 | }; |
| 124 | } |
no test coverage detected