Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prosjektforsiden blir nå vist når prosjektoppsett er ferdig #1351

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import ProjectSetup from 'projectSetup'
* Delete customizer for the specified project setup instance.
*
* @param instance Project setup instance
* @param reloadAfterRemoval Reload page after the customizer has been removed from the web
*/
export async function deleteCustomizer(
instance: ProjectSetup,
reloadAfterRemoval: boolean
instance: ProjectSetup
): Promise<void> {
const web = instance.sp.web as IWeb
const customActions = await web.userCustomActions<
Expand All @@ -27,7 +25,4 @@ export async function deleteCustomizer(
break
}
}
if (reloadAfterRemoval) {
window.location.href = window.location.href
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ export default class ProjectSetup extends BaseApplicationCustomizer<IProjectSetu
// eslint-disable-next-line default-case
switch (this._validation) {
case ProjectSetupValidation.InvalidWebLanguage: {
await deleteCustomizer(this, false)
await deleteCustomizer(this)
throw new ProjectSetupError(
'InvalidWebLanguage',
strings.InvalidLanguageErrorMessage,
strings.InvalidLanguageErrorStack
)
}
case ProjectSetupValidation.IsHubSite: {
await deleteCustomizer(this, false)
await deleteCustomizer(this)
throw new ProjectSetupError(
'IsHubSite',
strings.IsHubSiteErrorMessage,
Expand Down Expand Up @@ -160,7 +160,10 @@ export default class ProjectSetup extends BaseApplicationCustomizer<IProjectSetu
await this._ensureParentProjectPatch()
}

await deleteCustomizer(this, !this.properties.skipReload)
await deleteCustomizer(this)
if(!this.properties.skipReload) {
window.location.href = this.context.pageContext.web.absoluteUrl
}
} catch (error) {
this._renderErrorDialog({ error })
}
Expand Down Expand Up @@ -277,7 +280,7 @@ export default class ProjectSetup extends BaseApplicationCustomizer<IProjectSetu
version: this.version,
onDismiss: async () => {
if (this._isSetup) {
await deleteCustomizer(this, false)
await deleteCustomizer(this)
}
this._unmount(placeholder)
},
Expand Down
Loading