move into if

Signed-off-by: xuqian <xuqian65@huawei.com>
This commit is contained in:
xuqian 2024-10-12 10:45:56 +08:00
parent 6f7e00b522
commit bef19bab61

View File

@ -36,14 +36,14 @@ export default class DataAbility extends ServiceExtensionAbility {
private isSubscriber = false;
async sandbox2linkFile(key: string) {
try {
await deleteSandbox2linkFileData(key, true);
} catch (err) {
HiLog.error(TAG, `deleteSandbox2linkFileData error`);
}
let sandbox2linkFile: Map<string, (number | string | dlpPermission.DLPFile)[][]> =
GlobalContext.load('sandbox2linkFile') as Map<string, (number | string | dlpPermission.DLPFile)[][]>;
if (sandbox2linkFile.has(key)) {
try {
await deleteSandbox2linkFileData(key, true);
} catch (err) {
HiLog.error(TAG, `deleteSandbox2linkFileData error`);
}
let fileOpenHistory:Map<string, (number | string)[]> =
GlobalContext.load('fileOpenHistory') as Map<string, (number | string)[]>;
for (let item of Array.from<(string | (number | string)[])[]>(fileOpenHistory)) {