Skip to content

Commit

Permalink
v1.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Incpi committed Dec 3, 2024
1 parent a1c3dac commit 4a48780
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
Binary file removed bin/Dark CPI Extension.zip
Binary file not shown.
23 changes: 13 additions & 10 deletions host/CPI/main/heart-beat.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// URL parameters
const urlParams = new URLSearchParams(window.location.search);
const darkCPIParam = urlParams.get("darkcpi");
let retryCount = 0;
let retryCount = 1;

// Initialize variables
let selectedTheme = getLocalTheme() || "1";
Expand All @@ -23,28 +23,31 @@ function getCurrentSAPTheme() {
logger.log("Retrieving SAP theme...");
return sap.ui.getCore().getConfiguration().getTheme();
}

let timeoutId;
function retryAutocloseNavButton() {
try {
const navigationList = sap.ui.getCore().byId("shell--navigationList");
if (navigationList && navigationList.mProperties.expanded) {
sap.ui.getCore().byId("__button0").firePress();
logger.info("Navigation button closed");
clearTimeout(timeoutId);
return;
} else if (sap.ui.getCore().byId("__navigation0").mProperties.expanded) {
sap.ui.getCore().byId("container-app---app--sideNavigationToggleButton").firePress();
logger.info("Navigation button closed");
clearTimeout(timeoutId);
return;
} else {
logger.info("Navigation button closure Failed");
}
} catch (error) {
logger.error(`Failed to execute retryAutocloseNavButton on attempt ${retryCount + 1}: ${error.message}`);
} finally {
retryCount++;
if (retryCount <= 5) {
setTimeout(retryAutocloseNavButton, 500);
} else {
clearTimeout(retryAutocloseNavButton);
}
logger.error(`Failed to execute retryAutocloseNavButton on attempt ${retryCount}: ${error.message}`);
}
retryCount++;
if (retryCount <= 10) {
timeoutId = setTimeout(retryAutocloseNavButton, 800);
} else {
clearTimeout(timeoutId);
}
}

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Dark CPI",
"version": "1.3.6",
"version": "1.3.7",
"description": "Extension provides control to change theme to dark mode for SAP CPI, SAP Build zone",
"author": "Omkar Patel",
"homepage_url": "https://incpi.github.io",
Expand Down
4 changes: 2 additions & 2 deletions popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ <h1 class="text-xl font-bold"><span class="activeapp"></span> Application: <span
<div class="stats stats-vertical lg:stats-horizontal shadow">
<div class="stat">
<div class="stat-title">UTC Time</div>
<div class="stat-value" id="utc-time"></div>
<div class="stat-value" id="utc-time">25th May 2024, 00:00:00</div>
</div>
<div class="stat">
<div class="stat-title">Local Time</div>
<div class="stat-value" id="local-time"></div>
<div class="stat-value" id="local-time">25th May 2024, 00:00:00</div>
</div>
</div>
<!-- header -->
Expand Down

0 comments on commit 4a48780

Please sign in to comment.