Pebble App Framework: Phone API
    Preparing search index...

    Function prepareSettingsPage

    • Gets the Clay page ready to open, the way the phone does each time the wearer opens the settings.

      Each feature's configOpened runs first, while the old settings are still the saved ones. Then, when any feature has a page hook or the page has an API key row, the page goes through foldFeatures, each key row gets the key held for every provider of its select, and Clay gets the result. Clay writes the page from clay.config and clay.customFn on every generateUrl, so both are set here rather than building Clay again. The folds always start from the face's own page, which the defaults and the settings restore also read. With neither the page is left as Clay built it.

      A feature can hand over the Clay components its page hook's rows need, as the plugin sources do for their notes. Each one is registered for a page that uses it, and taken off again on an open whose page does not, so a page without those rows never carries their code. The hidden store is registered for a folded page that gains a hiddenStore row, and the builder's intro drops its mention of weather when the fold leaves no Weather section. The custom function is put together again on every open from that open's page, the framework's show and hide when it has a visibleWhen row, the key for each provider when it has a key row, and then the face's customClay, so no open keeps the one an earlier open needed. A fold that throws, or that needs a component nothing registers, opens the page Clay was built with, since a settings page that will not build is worse than one without the features' rows.

      startPebbleApp calls this on every showConfiguration, and the dev plugin's clay-preview calls it too, so the preview opens the page the phone would.

      Parameters

      • clay: {}

        The Clay page createClay built.

      • options: StartOptions

        What the face handed startPebbleApp.

      • features: FeatureHooks[]

        The started features, in the order the face lists them.

      • built: BuiltPage

        The page and the custom function Clay was built with.

      Returns void