mirror of
https://github.com/wekan/wekan.git
synced 2025-12-19 17:00:13 +01:00
Fixed Non-ASCII attachment filename will crash when downloading.
Thanks to xet7 ! Fixes #2759
This commit is contained in:
parent
843ff8eaaa
commit
c2da477735
277 changed files with 30568 additions and 52 deletions
51
packages/wekan-cfs-base-package/base-client.js
Normal file
51
packages/wekan-cfs-base-package/base-client.js
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
|
||||
//XXX not sure this is still working properly?
|
||||
FS.Utility.connectionLogin = function(connection) {
|
||||
// We check if the accounts package is installed, since we depend on
|
||||
// `Meteor.userId()`
|
||||
if (typeof Accounts !== 'undefined') {
|
||||
// Monitor logout from main connection
|
||||
Meteor.startup(function() {
|
||||
Tracker.autorun(function() {
|
||||
var userId = Meteor.userId();
|
||||
if (userId) {
|
||||
connection.onReconnect = function() {
|
||||
var token = Accounts._storedLoginToken();
|
||||
connection.apply('login', [{resume: token}], function(err, result) {
|
||||
if (!err && result) {
|
||||
connection.setUserId(result.id);
|
||||
}
|
||||
});
|
||||
};
|
||||
} else {
|
||||
connection.onReconnect = null;
|
||||
connection.setUserId(null);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @method FS.Utility.eachFile
|
||||
* @public
|
||||
* @param {Event} e - Browser event
|
||||
* @param {Function} f - Function to run for each file found in the event.
|
||||
* @returns {undefined}
|
||||
*
|
||||
* Utility for iteration over files in event
|
||||
*/
|
||||
FS.Utility.eachFile = function(e, f) {
|
||||
var evt = (e.originalEvent || e);
|
||||
|
||||
var files = evt.target.files;
|
||||
|
||||
if (!files || files.length === 0) {
|
||||
files = evt.dataTransfer ? evt.dataTransfer.files : [];
|
||||
}
|
||||
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
f(files[i], i);
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue