fix(tsconnect): lowercase name/size in waitingFiles JSON #2
@@ -166,10 +166,15 @@ func (i *jsIPN) waitingFiles() js.Value {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if wfs == nil {
|
type jsWaitingFile struct {
|
||||||
wfs = []apitype.WaitingFile{}
|
Name string `json:"name"`
|
||||||
|
Size int64 `json:"size"`
|
||||||
}
|
}
|
||||||
b, err := json.Marshal(wfs)
|
out := make([]jsWaitingFile, len(wfs))
|
||||||
|
for i, wf := range wfs {
|
||||||
|
out[i] = jsWaitingFile{Name: wf.Name, Size: wf.Size}
|
||||||
|
}
|
||||||
|
b, err := json.Marshal(out)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user