-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
Feat: Persist 'Share as Image' options #1581
base: main
Are you sure you want to change the base?
Feat: Persist 'Share as Image' options #1581
Conversation
|
||
db.setSetting( | ||
"share_as_image_preferences", | ||
JSON.parse(JSON.stringify(state)), |
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.
Alternative to this was
JSON.parse(JSON.stringify(state)), | |
{ | |
post: { ...state.post }, | |
comment: { ...state.comment }, | |
} |
passing state
directly, or using structuredClone
didn't work either.
@@ -0,0 +1,16 @@ | |||
import { ShareAsImagePreferences } from "./ShareAsImagePreferences"; | |||
|
|||
export const defaultPreferences: ShareAsImagePreferences = { |
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.
I'd like to have these in a separate file, as I intend to flip some of these values downstream
@aeharding also, currently one of the toggles is labelled "Include Post Text", which seems to be misleading. In case of image posts, this actually toggles the image within the screenshot Update: I've renamed it to "Include Post Content" |
@sharunkumar Can you try share as image on the post, not a comment? That is where it fails for me. |
I'll look into it in a bit |
const [includePostDetails, setIncludePostDetails] = useState( | ||
!("comment" in data), | ||
); |
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.
@aeharding I guess this was the cause of the issue, and its not browser dependent. I tried it in incognito window in edge and its reproducing
includePostDetails
is currently false by default in my config
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.
I believe I have fixed the issue in my latest commit: c8af557
(#1581)
let me know if there's anything else
a273f68
to
c8af557
Compare
8c8ca26
to
7957aa0
Compare
Resolves #1547
All the toggle buttons would be persisted
In the case where the user hits the upper limit for parent comments, the setting would remember it and set all future shares to have all parent comments visible