MCPcopy Index your code
hub / github.com/ColmapView/Colmapview.github.io / getAppStartupLoadPlan

Function getAppStartupLoadPlan

src/appStartupPolicy.ts:82–124  ·  view source on GitHub ↗
({
  shareData,
  legacyManifestUrl,
}: AppStartupLoadPlanOptions)

Source from the content-addressed store, hash-verified

80}
81
82export 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}

Callers 2

checkUrlAndLoadFunction · 0.90

Calls 1

getShareSelectedImageIdFunction · 0.85

Tested by

no test coverage detected