diff options
author | bptato <nincsnevem662@gmail.com> | 2023-05-14 13:57:37 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-05-14 13:57:37 +0200 |
commit | 755c1b7ece20de688c3f103f11b71055f6a4c727 (patch) | |
tree | adda4e83ed8f2be8f199f6b2a2459d7c26285cff /src/buffer | |
parent | b080ed197b1f027aa6f400840a4136d1451f9624 (diff) | |
download | chawan-755c1b7ece20de688c3f103f11b71055f6a4c727.tar.gz |
Set buffer state to LOADED on finishLoad
Diffstat (limited to 'src/buffer')
-rw-r--r-- | src/buffer/buffer.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buffer/buffer.nim b/src/buffer/buffer.nim index 2d93214a..4a091091 100644 --- a/src/buffer/buffer.nim +++ b/src/buffer/buffer.nim @@ -652,12 +652,11 @@ proc finishLoad(buffer: Buffer): EmptyPromise = buffer.sstream.setPosition(0) let (doc, _) = parseHTML(buffer.sstream, cs = some(cs), window = buffer.window, url = buffer.url) buffer.document = doc - p = buffer.loadResources(buffer.document) buffer.state = LOADING_RESOURCES + p = buffer.loadResources(buffer.document) else: p = EmptyPromise() p.resolve() - buffer.state = LOADED buffer.selector.unregister(buffer.fd) buffer.fd = -1 buffer.istream.close() @@ -715,6 +714,7 @@ proc onload(buffer: Buffer) = if buffer.istream.atEnd(): res.atend = true buffer.finishLoad().then(proc() = + buffer.state = LOADED buffer.resolveTask(LOAD, res)) return buffer.resolveTask(LOAD, res) |