-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
migrate BudgetList to typescript #3026
migrate BudgetList to typescript #3026
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
2ebfdf5
to
54cc2fa
Compare
// Remote files do not have the 'id' field | ||
function isNonRemoteFile( | ||
file: File, | ||
): file is LocalFile | SyncableLocalFile | SyncedLocalFile { | ||
return file.state !== 'remote'; | ||
} | ||
const nonRemoteFiles = allFiles.filter(isNonRemoteFile); | ||
const files = id ? nonRemoteFiles.filter(f => f.id !== id) : allFiles; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know if I should do this or check file.cloudFileId
if it's a RemoteFile
. I've just kept the things in their current form. I haven't thought much about the logic behind it all
export type LocalFile = Omit<Budget, 'cloudFileId' | 'groupId'> & { | ||
state: 'local'; | ||
hasKey: boolean; | ||
}; | ||
|
||
export type SyncableLocalFile = Budget & { | ||
cloudFileId: string; | ||
groupId: string; | ||
state: 'broken' | 'unknown'; | ||
hasKey: boolean; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File.hasKey
was used a few times in BudgetList.jsx
. I don't know how the logic for hasKey
is determined for local files. Can they be encrypted? If yes, why didn't they have the hasKey
property? I chose to add it, and default it to True
. That's because, in my view, if the file is imported locally, and is encrypted, if the user managed to import it, it means he has the key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Relates to #1483