Yetangitu / owncloud-apps

Applications for Nextcloud and Owncloud personal cloud server
GNU Affero General Public License v3.0
86 stars 41 forks source link

Not saving certain preferences / client not sending full preference data (fontSize, color, etc) #82

Closed xenithorb closed 6 years ago

xenithorb commented 6 years ago

Versions:

Nexcloud 13.0.0.14
PHP 7.1.13 (cli) (built: Jan  3 2018 11:00:58) ( NTS )
nginx version: nginx/1.13.8
files_reader 1.2.2

At present it seems impossible to save the fontSize preference, here's the object it's sending:

{
    "name": "activeStyles",
    "scope": "epubreader",
    "lastModified": "1519504848116149",
    "id": 2,
    "value": {
        "fontSize": true,
        "nightMode": true
    },
    "fileId": "0"
}

As far as I can tell it's not sending the server any information about the 104% that I set?

A similar object (basically the same) is sent when trying to change one of the colors:

{
    "name": "activeStyles",
    "scope": "epubreader",
    "lastModified": "1519506517447194",
    "id": 2,
    "value": {
        "fontSize": true,
        "nightMode": true
    },
    "fileId": "0"
}

Which is also not being saved. Are font size and custom colors supposed to save? ... The fact that it emits this in the first place kind of indicates that it should.

Originally copied from #81 as a new bug was discovered

Yetangitu commented 6 years ago

OK, I found the cause and fixed it ('the case of the missing setDefault'), change will be in the next release coming up R.S.N.

Yetangitu commented 6 years ago

Fixed in v1.2.3

BTW, these settings are defaults, they apply to all files opened with the EPUB renderer. There currently is no option to save these per-file. Maybe there should be?

xenithorb commented 6 years ago

I could see there being a per-file use case... example would be what I'm currently reading.... It needs to have the default font because it doesn't render properly without it for some reason, and if I force a certain font for the reading aspects, like Serif, then the code blocks look all serif-y then, which is not desirable. So for this book I explicitly want to set it to be whatever font the book says it's supposed to be (i.e. unset any font preferences). In other cases, I probably want a default Serif font of some sort if say, it's a novel or something.. Where i'm not necessarily worried about the internal structure of the words on the page (as with code blocks).

This fix should do for now though, as long as it saves that's fine. For the most part I read one thing at a time, so it's not really that big of a deal for me.

xenithorb commented 6 years ago

Yay! Tested on my updated Nextcloud server, both of my problems have been solved and preferences are now saved. Thank you!