@nextcloud/vue
Version:
Nextcloud vue components
42 lines (41 loc) • 1.18 kB
JavaScript
import { loadState } from "@nextcloud/initial-state";
import { l as logger } from "./logger-D3RVzcfQ.mjs";
/*!
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
function once(func) {
let wasCalled = false;
let result;
return (...args) => {
if (!wasCalled) {
wasCalled = true;
result = func(...args);
}
return result;
};
}
let realAppName = "missing-app-name";
try {
realAppName = appName;
} catch {
logger.error("The `@nextcloud/vue` library was used without setting / replacing the `appName`.");
}
const APP_NAME = realAppName;
let realAppVersion = "";
try {
realAppVersion = appVersion;
} catch {
logger.error("The `@nextcloud/vue` library was used without setting / replacing the `appVersion`.");
}
const APP_VERSION = realAppVersion;
const getLocalizedAppName = once(() => {
const activeApp = loadState("core", "active-app", APP_NAME);
return loadState("core", "apps", []).find(({ id }) => id === activeApp)?.name ?? APP_NAME;
});
export {
APP_NAME as A,
APP_VERSION as a,
getLocalizedAppName as g
};
//# sourceMappingURL=appName-DtnLUijR.mjs.map