package com.atlassian.stash.internal.repository.sync.web.conditions;

import com.atlassian.plugin.web.Condition;
import com.atlassian.stash.internal.repository.sync.RefSyncConfig;

import java.util.Map;

/**
 * @since 2.6
 */
public class IsRefSyncingPossibleCondition implements Condition {

    private final RefSyncConfig config;

    public IsRefSyncingPossibleCondition(RefSyncConfig config) {
        this.config = config;
    }

    @Override
    public void init(Map<String, String> params) {
    }

    @Override
    public boolean shouldDisplay(Map<String, Object> context) {
        return config.isPossible();
    }
}
