Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Settings React Don't on Windows?

I have an app with a settings page that should respond to settings changes made in the companion index.js. This works on the sim and Android, but not on Windows.

 

companion/index.js includes this:

settingsStorage.onchange = evt => {
  let textInput = JSON.parse(evt.newValue).name;
  let show = textInput!=="";
  settingsStorage.setItem('show',show);
  settingsStorage.setItem('status', JSON.stringify({'name':textInput}));
};

settings/index.jsx:

function mySettings(props) {
  return (
    <Page>
      <TextInput
        label="Text Input"
        settingsKey="textInput"
      />
      
      { JSON.parse(props.settings.show || 'false') && <Text>Thank you!</Text> }
      
      <TextInput
        label="Your text:"
        placeholder="Ready."
        settingsKey="status"
        disabled="true"
      />
    </Page>
  );
}

registerSettingsPage(mySettings);

Entering 'xxxx' on Android gives the expected result:

Android.png

However, on Windows, index.jsx doesn't react:

win10.png

Am I doing something wrong? Or is there a bug in the Windows app?

Peter McLennan
Gondwana Software
Best Answer
0 Votes
1 REPLY 1

I would greatly appreciate it if someone could verify whether this is a system bug, or just me. I'm loathe to release further apps that use dynamic settings if they don't work on Windows. I suspect that my apps aren't the only ones affected.

 

Here's a test project.

Peter McLennan
Gondwana Software
Best Answer
0 Votes