From 5876f5c737711c8c6fea3181c70ef83320689d96 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 1 Oct 2019 10:58:59 +0200 Subject: [PATCH] include user block location in support requests --- www/support/main.js | 12 ++++++++++-- www/support/ui.js | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/www/support/main.js b/www/support/main.js index 90aead240..b5ca65126 100644 --- a/www/support/main.js +++ b/www/support/main.js @@ -4,8 +4,10 @@ define([ '/api/config', '/common/dom-ready.js', '/common/requireconfig.js', - '/common/sframe-common-outer.js' -], function (nThen, ApiConfig, DomReady, RequireConfig, SFCommonO) { + '/common/sframe-common-outer.js', + '/common/outer/local-store.js', + '/common/outer/login-block.js', +], function (nThen, ApiConfig, DomReady, RequireConfig, SFCommonO, LocalStore, Block) { var requireConfig = RequireConfig(); // Loaded in load #2 @@ -43,6 +45,12 @@ define([ } var addData = function (obj) { if (category) { obj.category = category; } + var hash = LocalStore.getBlockHash(); + + if (!hash) { return; } + var parsed = Block.parseBlockHash(hash); + if (!parsed || !parsed.href) { return; } + obj.blockLocation = parsed.href; }; SFCommonO.start({ noRealtime: true, diff --git a/www/support/ui.js b/www/support/ui.js index 7cbf1e225..42ee89c94 100644 --- a/www/support/ui.js +++ b/www/support/ui.js @@ -24,6 +24,7 @@ define([ curvePublic: user.curvePublic, edPublic: privateData.edPublic, notifications: user.notifications, + blockLocation: privateData.blockLocation || '', }; if (typeof(ctx.pinUsage) === 'object') {