Problem with L.uci.load in my luci app

@jow, I hope you can help, I've added support for smartdns in adblock-fast, but I'm struggling with the luci app and need help!

I'm using this code to load uci config so that I can present a menu to select instance of smartdns further down.

However on systems without smartdns the L.uci.load results in an RPC error and my luci app doesn't load at all.

What's the best way to conditionally load the smartdns config?

Thanks!

did you tried with resolveDefault?

Also maybe you can consider implementing a custom load function and check for the presence of a file in the system and only then continue with load and rendering (with a chain of .then and promise)

2 Likes
			L.resolveDefault(L.uci.load("dhcp"), {}),
			L.resolveDefault(L.uci.load("smartdns"), {}),

worked, thank you so much for your prompt reply!!!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.