File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/packages/core/workspace/entity-detail Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { UmbSubmittableWorkspaceContextBase } from '../submittable/index.js' ;
2
2
import { UmbEntityWorkspaceDataManager } from '../entity/entity-workspace-data-manager.js' ;
3
+ import { UMB_WORKSPACE_PATH_PATTERN } from '../paths.js' ;
3
4
import { UMB_ACTION_EVENT_CONTEXT } from '@umbraco-cms/backoffice/action' ;
4
5
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api' ;
5
6
import type { UmbEntityModel } from '@umbraco-cms/backoffice/entity' ;
@@ -175,10 +176,12 @@ export abstract class UmbEntityDetailWorkspaceContextBase<
175
176
protected _checkWillNavigateAway ( newUrl : string ) {
176
177
let willNavigateAway = false ;
177
178
179
+ const workspacePathBase = UMB_WORKSPACE_PATH_PATTERN . generateLocal ( { entityType : this . getEntityType ( ) } ) ;
180
+
178
181
if ( this . getIsNew ( ) ) {
179
- willNavigateAway = ! newUrl . includes ( `${ this . getEntityType ( ) } /create` ) ;
182
+ willNavigateAway = ! newUrl . includes ( `${ workspacePathBase } /create` ) ;
180
183
} else {
181
- willNavigateAway = ! newUrl . includes ( this . getUnique ( ) ! ) ;
184
+ willNavigateAway = ! newUrl . includes ( ` ${ workspacePathBase } /edit/ ${ this . getUnique ( ) } ` ) ;
182
185
}
183
186
184
187
return willNavigateAway ;
You can’t perform that action at this time.
0 commit comments