From 370ae8110672fb0a9f712cabf37db587fd7b4821 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 2 Mar 2017 16:29:17 +0100 Subject: [PATCH] Use the display name in the backup file name if not logged in --- www/settings/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/settings/main.js b/www/settings/main.js index 70cf938dc..bbb7d4524 100644 --- a/www/settings/main.js +++ b/www/settings/main.js @@ -124,7 +124,8 @@ define([ var exportFile = function () { var sjson = JSON.stringify(obj); - var suggestion = obj.login_name + '-' + new Date().toDateString(); + var name = obj.login_name || obj[USERNAME_KEY] || Messages.anonymous; + var suggestion = name + '-' + new Date().toDateString(); Cryptpad.prompt(Cryptpad.Messages.exportPrompt, Cryptpad.fixFileName(suggestion) + '.json', function (filename) { if (!(typeof(filename) === 'string' && filename)) { return; }