Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnny committed Aug 11, 2022
1 parent 9fcb51f commit ee7be1b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# COMP/CON Changelog
## [2.3.10] (2022-8-11)

### Bug Fixes
- **Sign In** require e-mail for verification code functions (thanks super-salad!) [#2061](https://github.com/massif-press/compcon/issues/2061)
- **UI** Remove references to Roll20 (thanks msprijatelj!)
- **Active Mode** Filter actions based on LCP Active status (thanks super-salad!) [#2025](https://github.com/massif-press/compcon/issues/2025) [#2076](https://github.com/massif-press/compcon/issues/2076)
- **Pilot Mode** use Pilot as MechSkillController.Parent (thanks msprijatelj!) [#2070](https://github.com/massif-press/compcon/issues/2070)
- **Active Mode** fix indestructible tag typo (thanks msprijatelj!) [#2066](https://github.com/massif-press/compcon/issues/2066)
- **Cloud Syncing** fix permanent deletion function [#2074](https://github.com/massif-press/compcon/issues/2074) [#1977](https://github.com/massif-press/compcon/issues/1977) [#1976](https://github.com/massif-press/compcon/issues/1976)

### Features
- **Mech Hangar** Add editable system order (thanks super-salad!) [#1828](https://github.com/massif-press/compcon/issues/1828)
- **Mech Hangar** Add "redeploy" action to deployables (thanks msprijatelj!)


## [2.3.9] (2022-6-27)

### Bug Fixes
Expand Down
17 changes: 13 additions & 4 deletions src/cloud/item_sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const ListCloudItems = async (): Promise<any> => {
console.info(id)
return Storage.list('', { level: 'protected' })
.then(result => {
return result
console.log(result)
return result.filter(x => !x.key.includes('s3-remove-flag'))
})
.catch(err => console.error(err))
}
Expand Down Expand Up @@ -369,27 +370,34 @@ const GetSingleRemote = async (key: string, iid: string): Promise<any> => {

const DeleteForever = async (item: CollectionItem, skipSave?: boolean): Promise<any> => {
PermanentlyDeleteLocalItem(item)
Storage.remove(item.key, {
level: 'protected',
}).catch(err => console.error(err))
if (item.key.includes('active')) {
Rename(item.key, item.key.replace('active', 's3-remove-flag'))
}
if (item.key.includes('deleted')) {
Rename(item.key, item.key.replace('deleted', 's3-remove-flag'))
}
await new Promise(s => setTimeout(s, 600))
if (!skipSave) SaveLocalUpdates(item)
}

const DeleteAll = async (): Promise<any> => {
const items = await ListCloudItems()
const promises = items.map(i => DeleteForever(i, true))
Promise.all(promises)
await new Promise(s => setTimeout(s, 600))
}

const FlagCloudDelete = async (item: any): Promise<any> => {
if (item.key.includes('active')) {
Rename(item.key, item.key.replace('active', 'deleted'))
await new Promise(s => setTimeout(s, 600))
} else console.error('Item key does not contain "active"')
}

const FlagCloudRestore = async (item: any): Promise<any> => {
if (item.key.includes('deleted')) {
Rename(item.key, item.key.replace('deleted', 'active'))
await new Promise(s => setTimeout(s, 600))
} else console.error('Item key does not contain "deleted"')
}

Expand All @@ -400,6 +408,7 @@ const Rename = async (start: string, dest: string): Promise<any> => {
await Storage.remove(start, {
level: 'protected',
}).catch(err => console.error(err))
await new Promise(s => setTimeout(s, 600))
}

const AutoSyncAll = async (): Promise<any> => {
Expand Down

0 comments on commit ee7be1b

Please sign in to comment.