From 0f93e76e80d067f4afcb33d61c372bffae0a4eb6 Mon Sep 17 00:00:00 2001 From: tomasz1986 Date: Thu, 6 Jan 2022 12:46:15 +0100 Subject: [PATCH] gui: Use indexOf instead of startsWith for IE11 compatibility (ref #6940) (#8097) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use indexOf instead of startsWith to make the now translatable theme names appear correctly in IE11. This also prevents console log error spam in the browser. The same problem was previously reported in #6940. Signed-off-by: Tomasz WilczyƄski --- gui/default/syncthing/core/syncthingController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index fa565b8b8..692007351 100755 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -2808,7 +2808,7 @@ angular.module('syncthing.core') $scope.themeName = function (theme) { var translation = $translate.instant("theme-name-" + theme); - if (translation.startsWith("theme-name-")) { + if (translation.indexOf("theme-name-") == 0) { // Fall back to simple Title Casing on missing translation translation = theme.toLowerCase().replace(/(?:^|\s)\S/g, function (a) { return a.toUpperCase();