Skip to content

Only save necessary info to folder preferences #10560

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

Merged
merged 1 commit into from
Nov 24, 2022

Conversation

gave92
Copy link
Member

@gave92 gave92 commented Nov 24, 2022

Resolved / Related Issues
Items resolved / related issues by this PR.

  • None, small optimization

Currently we are serializing unnecessary/calculated fields of ColumnsViewModel to the preference DB. This PR adds [BsonIgnore] to those.

Before (each column per each folder):

"NameColumn": 
{
  "LengthIncludingGridSplitter": 
  {
    "Value": 248.0,
    "GridUnitType": "Pixel",
    "IsAbsolute": true,
    "IsAuto": false,
    "IsStar": false
  },
  "Length": 
  {
    "Value": 240.0,
    "GridUnitType": "Pixel",
    "IsAbsolute": true,
    "IsAuto": false,
    "IsStar": false
  },
  "UserCollapsed": false,
  "UserLength": 
  {
    "Value": 240.0,
    "GridUnitType": "Pixel",
    "IsAbsolute": true,
    "IsAuto": false,
    "IsStar": false
  },
  "UserLengthPixels": 240.0
},

After:

"NameColumn": 
{
  "UserCollapsed": false,
  "UserLengthPixels": 240.0
}

Validation
How did you test these changes?

  • Built and ran the app

Copy link
Member

@yaira2 yaira2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yaira2 yaira2 added the ready to merge Pull requests that are approved and ready to merge label Nov 24, 2022
@yaira2 yaira2 merged commit 936e503 into files-community:main Nov 24, 2022
@gave92 gave92 deleted the mini_pref branch November 24, 2022 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants