Skip to content

Commit b980811

Browse files
committed
Fixing the getLocalPageSettings.
1 parent 1a98af0 commit b980811

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

eform-client/src/app/plugins/modules/shared/services/shared-pn.service.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,20 @@ export class SharedPnService extends BaseService {
2222
}
2323

2424
getLocalPageSettings(localStorageItemName: string, pageName?: string): ApplicationPageModel {
25+
// debugger;
2526
const localPagesSettings = localStorage.getItem(localStorageItemName);
27+
let result;
2628
if (pageName) {
27-
return <ApplicationPageModel> JSON.parse(localPagesSettings).find(x => x.name === pageName);
29+
const bla = JSON.parse(localPagesSettings);
30+
if (bla.length > 1) {
31+
for (let i = 0; i < bla.length; i++) {
32+
const blu = bla[i];
33+
if (blu.name === pageName) {
34+
result = bla[i];
35+
}
36+
}
37+
}
38+
return <ApplicationPageModel> result;
2839
}
2940
return <ApplicationPageModel> JSON.parse(localPagesSettings);
3041
}

0 commit comments

Comments
 (0)