Commit 117bcb2f authored by Lisa (AI Assistant)'s avatar Lisa (AI Assistant)

Fix context not being stored as member variable

The setContext() method was setting prefs but not storing context as a class member variable, causing generateDeviceIdentity() to always see null context.
parent 454dacec
......@@ -71,8 +71,10 @@ class NodeClient() {
// SharedPreferences for device identity persistence
private var prefs: SharedPreferences? = null
private var context: Context? = null
fun setContext(context: Context) {
this.context = context
prefs = context.getSharedPreferences("openclaw_device_identity", Context.MODE_PRIVATE)
// Regenerate identity if needed (will load existing if available)
generateDeviceIdentity()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment