Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The ChartApiDelegate removeSeries method's onSeriesDeleted callback is not called #124

Open
C-Radu-V opened this issue Feb 16, 2023 · 0 comments

Comments

@C-Radu-V
Copy link

C-Radu-V commented Feb 16, 2023

Correct me if I'm wrong, I may be missing something, but from what I see, it seems like

override fun removeSeries(seriesApi: SeriesApi, onSeriesDeleted: () -> Unit) {
        if (seriesApi is ChartRuntimeObject) {
            assert(seriesApi.getVersion() == getVersion()) {
                "The object should be removed by the same ChartApi as it was created"
            }
        }

        controller.callFunction(
            REMOVE_SERIES,
            mapOf(SERIES_UUID to seriesApi.uuid),
            onSeriesDeleted
        )
}

calls

fun callFunction(
        name: String,
        params: Map<String, Any> = emptyMap(),
        callback: (() -> Unit)?
    ): String {
        @Suppress("UNCHECKED_CAST")
        return callBridgeFunction(name, params, callback as? (Any?) -> Unit)
    }

in which case callback as? (Any?) -> Unit will cause the callBridgeFunction to be called with null callback parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant