Skip to content

Commit f089940

Browse files
authored
Update index.ts
Fixes of typos
1 parent 1d6d7be commit f089940

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

src/index.ts

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,42 @@ export default class LaunchpadUtils {
33
public static crossAppNavigate(sSemObject: string, sAction: string, oParams: object, sAppend?: string) {
44
if (typeof window !== 'undefined' && window.hasOwnProperty('sap')) {
55
// @ts-ignore
6-
let oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");
7-
let hash =
8-
(oCrossAppNavigator &&
9-
oCrossAppNavigator.hrefForExternal({
6+
sap.ushell.Container.getServiceAsync("CrossApplicationNavigation").then(function(oService){
7+
let hash =
8+
(oService &&
9+
oService.hrefForExternal({
1010
target: {
1111
semanticObject: sSemObject,
1212
action: sAppend ? sAction + sAppend : sAction,
1313
},
1414
params: oParams,
1515
})) || "";
16-
let sintent = "#" + sSemObject + "=" + sAction;
16+
let sintent = "#" + sSemObject + "=" + sAction;
1717

18-
oCrossAppNavigator.isintentSupported([sintent]).done(
19-
function (olntentSupported: object) {
20-
// @ts-ignore
21-
if (
22-
olntentSupported &&
23-
// @ts-ignore
24-
olntentSupported[sIntent] &&
18+
oService.isIntentSupported([sintent]).done(
19+
function (olntentSupported: object) {
2520
// @ts-ignore
26-
olntentSupported[sintent].supported === true
27-
) {
28-
oCrossAppNavigator.toExternal({
29-
target: {
30-
shellHash: hash,
31-
},
32-
});
33-
} else {
34-
console.error("Intent + sintent + is not supported");
35-
}
36-
}.bind(this)
37-
);
21+
if (
22+
olntentSupported &&
23+
// @ts-ignore
24+
olntentSupported[sintent] &&
25+
// @ts-ignore
26+
olntentSupported[sintent].supported === true
27+
) {
28+
oService.toExternal({
29+
target: {
30+
shellHash: hash,
31+
},
32+
});
33+
} else {
34+
console.error("Intent " + sintent + " is not supported");
35+
}
36+
// @ts-ignore
37+
}.bind(this));
38+
}.bind(this));
3839
}
3940
else {
40-
console.log("you must work in fiori launchpad")
41+
console.log("You must work in fiori launchpad")
4142
}
4243
}
4344
}

0 commit comments

Comments
 (0)