src/extensions/default/HealthData/HealthDataUtils.js
function getUserInstalledTheme() {
        var result = new $.Deferred();

        var installedTheme = themesPref.get("theme"),
            bracketsTheme;

        if (installedTheme === "light-theme" || installedTheme === "dark-theme") {
            return result.resolve(installedTheme);
        }

        if (!ExtensionManager.hasDownloadedRegistry) {
            ExtensionManager.downloadRegistry().done(function () {
                bracketsTheme = ExtensionManager.extensions[installedTheme];
                if (bracketsTheme && bracketsTheme.installInfo && bracketsTheme.installInfo.locationType === ExtensionManager.LOCATION_USER && bracketsTheme.registryInfo) {
                    result.resolve(installedTheme);
                } else {
                    result.reject();
                }
            })
                .fail(function () {
                    result.reject();
                });
        } else {
            bracketsTheme = ExtensionManager.extensions[installedTheme];
            if (bracketsTheme && bracketsTheme.installInfo && bracketsTheme.installInfo.locationType === ExtensionManager.LOCATION_USER && bracketsTheme.registryInfo) {
                result.resolve(installedTheme);
            } else {
                result.reject();
            }
        }

        return result.promise();
    }
function getUserInstalledTheme() {
        var result = new $.Deferred();

        var installedTheme = themesPref.get("theme"),
            bracketsTheme;

        if (installedTheme === "light-theme" || installedTheme === "dark-theme") {
            return result.resolve(installedTheme);
        }

        if (!ExtensionManager.hasDownloadedRegistry) {
            ExtensionManager.downloadRegistry().done(function () {
                bracketsTheme = ExtensionManager.extensions[installedTheme];
                if (bracketsTheme && bracketsTheme.installInfo && bracketsTheme.installInfo.locationType === ExtensionManager.LOCATION_USER && bracketsTheme.registryInfo) {
                    result.resolve(installedTheme);
                } else {
                    result.reject();
                }
            })
                .fail(function () {
                    result.reject();
                });
        } else {
            bracketsTheme = ExtensionManager.extensions[installedTheme];
            if (bracketsTheme && bracketsTheme.installInfo && bracketsTheme.installInfo.locationType === ExtensionManager.LOCATION_USER && bracketsTheme.registryInfo) {
                result.resolve(installedTheme);
            } else {
                result.reject();
            }
        }

        return result.promise();
    }
function getUserInstalledTheme ( ) { var result = new $ . Deferred ( ) ; var installedTheme = themesPref . get ( "theme" ) , bracketsTheme ; if ( installedTheme === "light-theme" || installedTheme === "dark-theme" ) { return result . resolve ( installedTheme ) ; } if ( ! ExtensionManager . hasDownloadedRegistry ) { ExtensionManager . downloadRegistry ( ) . done ( function ( ) { bracketsTheme = ExtensionManager . extensions [ installedTheme ] ; if ( bracketsTheme && bracketsTheme . installInfo && bracketsTheme . installInfo . locationType === ExtensionManager . LOCATION_USER && bracketsTheme . registryInfo ) { result . resolve ( installedTheme ) ; } else { result . reject ( ) ; } } ) . fail ( function ( ) { result . reject ( ) ; } ) ; } else { bracketsTheme = ExtensionManager . extensions [ installedTheme ] ; if ( bracketsTheme && bracketsTheme . installInfo && bracketsTheme . installInfo . locationType === ExtensionManager . LOCATION_USER && bracketsTheme . registryInfo ) { result . resolve ( installedTheme ) ; } else { result . reject ( ) ; } } return result . promise ( ) ; }
Utility function to get the user installed theme which are present in the registry
Utility function to get the user installed theme which are present in the registry