Skip to content

Commit

Permalink
Allow non-nullish falsy option values in reset
Browse files Browse the repository at this point in the history
  • Loading branch information
bearfriend committed Aug 29, 2023
1 parent ed89c49 commit c906c79
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/browser/reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ export function requestMouseReset() {
export async function reset(opts) {

opts = opts || {};
opts.lang = opts.lang || DEFAULT_LANG;
opts.mathjax = opts.mathjax || {};
opts.lang = opts.lang ?? DEFAULT_LANG;
opts.mathjax = opts.mathjax ?? {};
opts.mathjax.renderLatex = (typeof opts.mathjax.renderLatex === 'boolean') ? opts.mathjax.renderLatex : DEFAULT_MATHJAX_RENDER_LATEX;
opts.rtl = opts.lang.startsWith('ar') || !!opts.rtl;
opts.viewport = opts.viewport || {};
opts.viewport.height = opts.viewport.height || DEFAULT_VIEWPORT_HEIGHT;
opts.viewport.width = opts.viewport.width || DEFAULT_VIEWPORT_WIDTH;
opts.viewport = opts.viewport ?? {};
opts.viewport.height = opts.viewport.height ?? DEFAULT_VIEWPORT_HEIGHT;
opts.viewport.width = opts.viewport.width ?? DEFAULT_VIEWPORT_WIDTH;

let awaitNextFrame = false;

Expand Down

0 comments on commit c906c79

Please sign in to comment.