mirror of https://github.com/zulip/zulip.git
activity.js: Add setter for new_user_input.
After migration to an ES6 module, `new_user_input` would no longer be mutable from outside the module. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
parent
ff8351fb71
commit
30d7090621
|
@ -15,8 +15,6 @@
|
|||
|
||||
const emoji_codes = zrequire("emoji_codes", "generated/emoji/emoji_codes.json");
|
||||
|
||||
set_global("activity", {});
|
||||
|
||||
set_global("navigator", {
|
||||
platform: "",
|
||||
});
|
||||
|
@ -36,6 +34,7 @@ emoji.initialize({
|
|||
emoji_codes,
|
||||
});
|
||||
|
||||
zrequire("activity");
|
||||
const hotkey = zrequire("hotkey");
|
||||
zrequire("common");
|
||||
|
||||
|
|
|
@ -29,6 +29,9 @@ exports.client_is_active = document.hasFocus && document.hasFocus();
|
|||
// if this was a server-initiated-reload to avoid counting a
|
||||
// server-initiated reload as user activity.
|
||||
exports.new_user_input = true;
|
||||
exports.set_new_user_input = function (value) {
|
||||
exports.new_user_input = value;
|
||||
};
|
||||
|
||||
function update_pm_count_in_dom(count_span, value_span, count) {
|
||||
const li = count_span.parents("li");
|
||||
|
|
|
@ -860,7 +860,7 @@ exports.process_hotkey = function (e, hotkey) {
|
|||
instead just let keypress go for it. */
|
||||
|
||||
exports.process_keydown = function (e) {
|
||||
activity.new_user_input = true;
|
||||
activity.set_new_user_input(true);
|
||||
const hotkey = exports.get_keydown_hotkey(e);
|
||||
if (!hotkey) {
|
||||
return false;
|
||||
|
|
|
@ -167,7 +167,7 @@ exports.initialize = function () {
|
|||
page_params.initial_narrow_offset = narrow_offset;
|
||||
}
|
||||
|
||||
activity.new_user_input = false;
|
||||
activity.set_new_user_input(false);
|
||||
hashchange.changehash(vars.oldhash);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue