Skip to content

Commit bac6791

Browse files
committed
Update assets.simba
1 parent 7307c26 commit bac6791

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

‎utils/assets.simba‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,17 @@ Record for managing WaspLib asset downloads and updates.
1818
Lock: TLock;
1919
end;
2020

21-
function TWLAssets.GetJSON(url: String): TJSONObject;
21+
function TWLAssets.GetJSON(): TJSONObject;
2222
var
2323
parser: TJSONParser;
2424
response: String;
2525
begin
26-
Self.URL := url;
26+
if Self.URL = '' then
27+
begin
28+
DebugLn('WLAssets', 'You don''t have an assets URL setup. If you are not providing your own assets you can''t run scripts.', ELogLevel.WARN);
29+
Exit(nil);
30+
end;
31+
2732
parser := new TJSONParser();
2833

2934
try
@@ -91,18 +96,15 @@ end;
9196
```pascal
9297
procedure TWLAssets.Update();
9398
```
94-
Internal method used to update [WaspLib Assets]('https://github.com/WaspScripts/wasp-assets/).
99+
Internal method used to update WaspLib Assets.
95100
*)
96101
procedure TWLAssets.Update();
97102
var
98103
i: Integer;
99104
timer: TCountDown;
100105
key, path: String;
101106
begin
102-
Self.JSON := Self.GetJSON('https://db.waspscripts.dev/storage/v1/object/public/assets/');
103-
104-
if Self.JSON = nil then
105-
Self.JSON := Self.GetJSON('https://raw.githubusercontent.com/WaspScripts/wasp-assets/refs/heads/main/');
107+
Self.JSON := Self.GetJSON();
106108

107109
if Self.JSON = nil then
108110
begin

0 commit comments

Comments
 (0)