From 269856a00203d9d92d94f6097ddff2c2637439db Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Mon, 31 May 2021 00:20:15 +0200 Subject: [PATCH] Rename utility function --- Utils.ts | 2 +- preferences.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Utils.ts b/Utils.ts index 506cfd9ff4..bcf87a250e 100644 --- a/Utils.ts +++ b/Utils.ts @@ -301,7 +301,7 @@ export class Utils { * @param contents * @param fileName */ - public static downloadTxtFile(contents: string, fileName: string = "download.txt") { + public static offerContentsAsDownloadableFile(contents: string, fileName: string = "download.txt") { const element = document.createElement("a"); const file = new Blob([contents], {type: 'text/plain'}); element.href = URL.createObjectURL(file); diff --git a/preferences.ts b/preferences.ts index 9a98e80594..7f390c7976 100644 --- a/preferences.ts +++ b/preferences.ts @@ -89,7 +89,7 @@ function clearAll(preferences){ function SalvageButton(theme: { themeName: string, contents: string }) { return new SubtleButton("./assets/svg/bug.svg", "Download broken theme " + theme.themeName).onClick( () => { - Utils.downloadTxtFile(theme.contents, theme.themeName + ".json") + Utils.offerContentsAsDownloadableFile(theme.contents, theme.themeName + ".json") } ) }