Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Feb 14, 2024
1 parent c424619 commit 5f7233a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
17 changes: 10 additions & 7 deletions frontend/common/Feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const init_firebase = async () => {
firebase_load_promise = async(async () => {
let [{ initializeApp }, firestore_module] = await Promise.all([
// @ts-ignore
import("https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js"),
import("https://www.gstatic.com/firebasejs/10.8.0/firebase-app.js"),
// @ts-ignore
import("https://www.gstatic.com/firebasejs/9.3.0/firebase-firestore.js"),
import("https://www.gstatic.com/firebasejs/10.8.0/firebase-firestore.js"),
])
let { getFirestore, addDoc, doc, collection } = firestore_module

Expand All @@ -28,10 +28,11 @@ const init_firebase = async () => {
let feedback_db = collection(db, "feedback")

let add_feedback = async (feedback) => {
await addDoc(feedback_db, feedback)
let docref = await addDoc(feedback_db, feedback)
console.debug("Firestore doc created ", docref.id, docref)
}

console.log("🔥base loaded")
console.log("🔥base loaded", { initializeApp, firestore_module, app, db, feedback_db, add_feedback })

// @ts-ignore
return add_feedback
Expand All @@ -44,19 +45,21 @@ export const init_feedback = async () => {
try {
// Only load firebase when the feedback form is touched
const feedbackform = document.querySelector("form#feedback")
if (feedbackform == null) return
feedbackform.addEventListener("submit", (e) => {
const email = prompt("Would you like us to contact you?\n\nEmail: (leave blank to stay anonymous 👀)")

e.preventDefault()

async(async () => {
try {
const feedback = String(new FormData(e.target).get("opinion"))
if (feedback.length < 4) return

let add_feedback = await init_firebase()
await timeout_promise(
add_feedback({
// @ts-ignore
feedback: new FormData(e.target).get("opinion"),
// @ts-ignore
feedback,
timestamp: Date.now(),
email: email ? email : "",
}),
Expand Down
2 changes: 1 addition & 1 deletion src/evaluation/MacroAnalysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function resolve_topology(
Failure(ErrorException("shutdown"))
end
catch error
@error "Macro call expansion failed with a non-macroexpand error" error
@error "Macro call expansion failed with a non-macroexpand error" exception=(error,catch_backtrace()) cell.code
Failure(error)
end
if result isa Success
Expand Down
2 changes: 1 addition & 1 deletion src/notebook/path helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function tryexpanduser(path)
end
end

tamepath = abspath tryexpanduser
const tamepath = abspath tryexpanduser

"Block until reading the file two times in a row gave the same result."
function wait_until_file_unchanged(filename::String, timeout::Real, last_contents::String="")::Nothing
Expand Down
4 changes: 2 additions & 2 deletions test/frontend/helpers/pluto.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ const waitForPlutoBusy = async (page, iWantBusiness, options) => {
await page.waitForFunction(
(iWantBusiness) => {
let quiet = //@ts-ignore
document?.body?._update_is_ongoing === false &&
(document?.body?._update_is_ongoing ?? false) === false &&
//@ts-ignore
document?.body?._js_init_set?.size === 0 &&
(document?.body?._js_init_set?.size ?? 0) === 0 &&
document?.body?.classList?.contains("loading") === false &&
document?.querySelector(`#process-status-tab-button.something_is_happening`) == null &&
document?.querySelector(`pluto-cell.running, pluto-cell.queued, pluto-cell.internal_test_queued`) == null
Expand Down

0 comments on commit 5f7233a

Please sign in to comment.