web: allow custom app title

This commit is contained in:
Abdullah Atta
2023-08-08 13:18:27 +05:00
committed by Abdullah Atta
parent 77eb661b0e
commit a5d39a18a7
3 changed files with 4 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ declare global {
var IS_TESTING: boolean;
var PLATFORM: "web" | "desktop";
var IS_BETA: boolean;
var APP_TITLE: string;
interface Window {
os?: () => NodeJS.Platform | "mas";

View File

@@ -18,6 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
export const setDocumentTitle = (title?: string) => {
if (!title) document.title = "Notesnook";
else document.title = `${title} - Notesnook`;
if (!title) document.title = APP_TITLE;
else document.title = `${title} - ${APP_TITLE}`;
};

View File

@@ -64,6 +64,7 @@ export default defineConfig({
}
},
define: {
APP_TITLE: `"${isThemeBuilder ? "Notesnook Theme Builder" : "Notesnook"}"`,
GIT_HASH: `"${gitHash}"`,
APP_VERSION: `"${appVersion}"`,
PUBLIC_URL: `"${process.env.PUBLIC_URL || ""}"`,