mirror of
https://github.com/gradio-app/gradio.git
synced 2025-04-06 12:30:29 +08:00
Fix the Wasm worker to initialize the app directories (#6887)
* Fix the Wasm worker to initialize the app directories * add changeset * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
parent
31c23166f0
commit
8333db83ac
6
.changeset/tender-parks-change.md
Normal file
6
.changeset/tender-parks-change.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
"@gradio/wasm": patch
|
||||
"gradio": patch
|
||||
---
|
||||
|
||||
feat:Fix the Wasm worker to initialize the app directories
|
@ -187,6 +187,13 @@ async function initializeApp(
|
||||
options: InMessageInitApp["data"],
|
||||
updateProgress: (log: string) => void
|
||||
): Promise<void> {
|
||||
const appHomeDir = getAppHomeDir(appId);
|
||||
console.debug("Creating a home directory for the app.", {
|
||||
appId,
|
||||
appHomeDir
|
||||
});
|
||||
pyodide.FS.mkdir(appHomeDir);
|
||||
|
||||
console.debug("Mounting files.", options.files);
|
||||
updateProgress("Mounting files");
|
||||
await Promise.all(
|
||||
@ -249,6 +256,8 @@ function setupMessageHandler(receiver: MessageTransceiver): void {
|
||||
// This multi-app mechanism was introduced for a SharedWorker, but the same mechanism is used for a DedicatedWorker as well.
|
||||
const appId = generateRandomString(8);
|
||||
|
||||
console.debug("Set up a new app.", { appId });
|
||||
|
||||
const updateProgress = (log: string): void => {
|
||||
const message: OutMessage = {
|
||||
type: "progress-update",
|
||||
|
Loading…
x
Reference in New Issue
Block a user