Initial upload to Gitea
This commit is contained in:
1 parent
78193254ad
commit
8478998cae
1485 files changed
+461025
-42348
No files matched your search
@@ -0,0 +1,25 @@
|
||||
(function (root) {
|
||||
'use strict';
|
||||
const ids = new Map();
|
||||
const key = (email) => String(email || '').trim().toLowerCase();
|
||||
const changed = () => new Error('Account state changed. Close this dialog, reload accounts, and select the account again.');
|
||||
|
||||
// adpanel:account-retry-identity - a refreshed token cannot retarget a
|
||||
// pending action to a replacement row that reuses its email.
|
||||
root.ADPanelAccountTargets = {
|
||||
update(accounts) {
|
||||
ids.clear();
|
||||
for (const account of accounts || []) {
|
||||
if (Number.isSafeInteger(account.id) && account.id > 0) ids.set(key(account.email), account.id);
|
||||
}
|
||||
},
|
||||
select(email) {
|
||||
const id = ids.get(key(email));
|
||||
return Object.freeze({ email: key(email), id: id || 0 });
|
||||
},
|
||||
payload(target, body) {
|
||||
if (!target || !target.id || ids.get(target.email) !== target.id) throw changed();
|
||||
return { ...body, expectedTargetId: target.id };
|
||||
}
|
||||
};
|
||||
})(window);
|
||||
Reference in new issue
Block a user