diff options
| author | bptato <nincsnevem662@gmail.com> | 2024-08-13 22:48:12 +0200 |
|---|---|---|
| committer | bptato <nincsnevem662@gmail.com> | 2024-08-13 23:03:41 +0200 |
| commit | 885a3493b6cad4b4247a200928fe61e41883aaba (patch) | |
| tree | 2b823ef18043c775f21b8ad723c826ffdc6b2663 /src/io | |
| parent | 968de41082280dde47bac7c2bb59522284b4c672 (diff) | |
| download | chawan-885a3493b6cad4b4247a200928fe61e41883aaba.tar.gz | |
xhr: progress
* fix header case sensitivity issues
-> probably still wrong as it discards the original
casing. better than nothing, anyway
* fix fulfill on generic promises
* support standard open() async parameter weirdness
* refactor loader response body reading (so bodyRead is no longer
mandatory)
* actually read response body
still missing: response body getters
Diffstat (limited to 'src/io')
| -rw-r--r-- | src/io/promise.nim | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/io/promise.nim b/src/io/promise.nim index 3c01e214..55dcfbf0 100644 --- a/src/io/promise.nim +++ b/src/io/promise.nim @@ -59,12 +59,11 @@ proc resolve*(promise: EmptyPromise) = promise.next = nil proc resolve*[T](promise: Promise[T]; res: T) = - if promise.cb != nil: - if promise.get != nil: - promise.get(promise.opaque, promise.res) - promise.get = nil - promise.res = res - promise.resolve() + if promise.get != nil: + promise.get(promise.opaque, promise.res) + promise.get = nil + promise.res = res + promise.resolve() proc resolve*(map: var PromiseMap; promiseid: int) = var promise: EmptyPromise |