TeachLAFrontend icon indicating copy to clipboard operation
TeachLAFrontend copied to clipboard

Refactor: remove function type check

Open TomBinford opened this issue 2 years ago • 0 comments

This commit introduced the following check: https://github.com/uclaacm/TeachLAFrontend/blob/6f603af2500fedd7014795f1d9bfd38b9b005eed/src/components/Output/Output.js#L113-L118 This was meant to verify that getSrcDoc() is safe to run, but

  1. It should be !(getSrcDoc && ... ); as written the condition is never true.
  2. We supply getSrcDoc so we'd get an exception and find the problem ourselves if getSrcDoc is not a function. The check isn't any more useful than an exception being thrown.

TomBinford avatar May 03 '23 03:05 TomBinford