Skip to content

Provide a way for button actions to cancel subsequent actions #395

@zxaos

Description

@zxaos

Is your Feature Request Related to a Problem?

I have a button that should only actually do things when a metadata value is above some number.

Describe the Feature you'd Like

It'd be great to be able to do a simple bit of logic and return false (or something) if a button's actions should stop.

Additional Context

For example:

label: Level Up
icon: "crown"
hidden: true
id: "xp-level"
style: primary
actions:
  - type: inlineJS
    code: "if (this.context.metadata.frontmatter.xp < 1000){ console.log('not enough xp'); return false; }"
  - type: updateMetadata
    bindTarget: xp
    evaluate: true
    value: x - 1000
  - type: updateMetadata
    bindTarget: level
    evaluate: true
    value: x + 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions