MCPcopy Create free account
hub / github.com/error311/FileRise / isTrashDisabledForSource

Function isTrashDisabledForSource

public/js/folderManager.js:231–251  ·  view source on GitHub ↗
(sourceId = '')

Source from the content-addressed store, hash-verified

229}
230
231function isTrashDisabledForSource(sourceId = '') {
232 const id = String(sourceId || getActiveSourceId() || '').trim();
233 if (!id) return false;
234
235 try {
236 if (typeof window.__frGetSourceMetaById === 'function') {
237 const meta = window.__frGetSourceMetaById(id);
238 if (meta && typeof meta === 'object' && Object.prototype.hasOwnProperty.call(meta, 'disableTrash')) {
239 return !!meta.disableTrash;
240 }
241 }
242 } catch (e) { /* ignore */ }
243
244 const sel = document.getElementById('sourceSelector');
245 if (sel) {
246 const opt = Array.from(sel.options).find(o => o.value === id);
247 if (opt) return opt.dataset?.sourceDisableTrash === '1';
248 }
249
250 return false;
251}
252
253function isFtpSourceId(sourceId = '') {
254 const type = String(getSourceTypeById(sourceId || getActiveSourceId()) || '').toLowerCase();

Callers 1

placeRecycleBinNodeFunction · 0.85

Calls 1

getActiveSourceIdFunction · 0.70

Tested by

no test coverage detected